Powershell dot sourcing question.# DotNet - 窗口里的风景
M7
1 楼
I have two scripts, A.ps1 is the main function and B.ps1 has all the
functions that A.ps1 calls. Both scripts are in the same folder.
To put B into A’s scope, I tried to put the following in A.ps1
. .\B.ps1
With the above statement, or I put the path in single or double quotes, I
always get this error message:
The term '.\B.ps1' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
If I use the absolute path, the script runs smoothly.
. C:\Users\xyz\Desktop\B.ps1
Any clue what is wrong?
Thanks a lot!
functions that A.ps1 calls. Both scripts are in the same folder.
To put B into A’s scope, I tried to put the following in A.ps1
. .\B.ps1
With the above statement, or I put the path in single or double quotes, I
always get this error message:
The term '.\B.ps1' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
If I use the absolute path, the script runs smoothly.
. C:\Users\xyz\Desktop\B.ps1
Any clue what is wrong?
Thanks a lot!