Skip to content

Instantly share code, notes, and snippets.

@45413
45413 / string-and-filename-manipulation.ps1
Last active November 14, 2023 22:47
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