ConvertTo UncPath - PPOSHGROUP/PPoShTools GitHub Wiki
PPoShTools -> ConvertTo-UncPath.ps1
A simple function to convert a local file path and a computer name to a network UNC path.
ConvertTo-UncPath [-LocalFilePath] <String> [-ComputerName] <String[]>
[<CommonParameters>]
A file path ie. C:\Windows\somefile.txt
- PipelineInput: true (ByValue, ByPropertyName)
- Required: true
One or more computers in which the file path exists on
- PipelineInput: true (ByValue, ByPropertyName)
- Required: true
ConvertTo-UncPath -LocalFilePath 'c:\adminTools\SomeFolder' -ComputerName 'SomeRemoteComputer'
\SomeRemoteComputer\c$\adminTools\SomeFolder
ConvertTo-UncPath -LocalFilePath 'c:\adminTools\SomeFolder' -ComputerName 'SomeRemoteComputer','SomeAnotherComputer'
\SomeRemoteComputer\c$\adminTools\SomeFolder \SomeAnotherComputer\c$\adminTools\SomeFolder