Get Absolute Path from Relative Path in PowerShell

The get the absolute path given a relative file path Resolve-Path cmdlet can be used.

Resolve-Path ".\filename.txt"
Path
----
C:\Path\filename.txt

To write to a relative path the Set-Content cmdlet can be used

"Content" | Set-Content ".\filename.txt"
PowerShell
File
Path

Comments