Powershell – Path and filename

[codesyntax lang=”powershell”]

[io.path]::GetFileNameWithoutExtension("c:\temp\myfile.txt")
[io.path]::GetDirectoryName("c:\temp\myfile.txt")
[io.path]::GetTempPath()

[/codesyntax]Some simple examples on how to get filename and folder out of a path with powershell and .Net

This entry was posted in Powershell. Bookmark the permalink.