Skip to content

Instantly share code, notes, and snippets.

@45413
45413 / string-and-filename-manipulation.ps1
Last active August 4, 2024 01:45
Powershell String and Filename Manipulation
# Working with a [System.IO.FileInfo] Object
## Get file object into variable
PS C:\DATA> $file = Get-ChildItem C:\DATA\test.xls
## Full path name
PS C:\DATA> $file.FullName
C:\DATA\test.xls
## Filename including extension
PS C:\DATA> $file.Name