I am invoking one of my scripts from a network path. Script basically only calls another program and passes it the current directory as an argument.
When I pass $ PWD as an argument, the path my program sees is "Microsoft.PowerShell.Core \ FileSystem :: \ my_server \ public" and it certainly fails because it expects a standard UNC path.
My ad hoc solution was simply to make .Replace("Microsoft.PowerShell.Core\FileSystem::", "") , and it worked, but I'm wondering what is the real way to convert the path from this "powershell" format to standard UNC.
Is there a better solution?
Klark source share