Powershell ps1 file “is not recognized as a cmdlet, function, operable program, or script file.”

前端 未结 3 2020
你的背包
你的背包 2020-12-11 14:36

I made a Powershell function just now and saved it to a ps1 file. However, when I try to execute it from within powershell, it won\'t run.

I\'ve allready changed to

3条回答
  •  感动是毒
    2020-12-11 15:03

    I could be off base here, but is it that your script is defining a function, rather than executing it? Perhaps you need to "source" the script:

    . .\listallpaths.ps1
    

    ... so that now your "listallpaths" function is defined.

提交回复
热议问题