[lang-ref] ( get_extension ) ( powershell )

It 'should get extension' {
    # Extension

    $r = ([System.IO.FileInfo]'/path/to/file1.txt').Extension
    $r | Should -Be '.txt'

    # if path exists, just do this
    # (Get-Item '/path/to/file1.txt').Name

    $r = ([System.IO.FileInfo]'/path/to/file1.tar.gz').Extension
    $r | Should -Be '.gz'
}