Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Error "Split-Path : Cannot bind argument to parameter 'Path' because it is null. At line:3 char:27"

$
0
0

Hello,

In C:\Users\Powershell folder, I a a script as ZZZ_Test. This script writes script's directory as below:

$MyDirectory = (Split-Path $script:MyInvocation.MyCommand.Path) + "\"

"---> " + $MyDirectory

Generally it doesn't run or run with error as below. But sometimes, it runs succesfully with no error.

Do you know what can be the problem. Is it a library bug or I skip something?

 


Viewing all articles
Browse latest Browse all 8583

Trending Articles