HI i am having problem in calling a sub script from the main script using powershell on a remote server
I have the main script which is call 1.ps1
the other script is called 2.ps1
Here are the scripts
1.ps1 contains this code &("C:\Users\test\Desktop\remotely run scripts\2.ps1")
2.ps1 contains this code new-item -type file c:\itworksagain.txt
The command which i am using is as follows
invoke-command -computer "remoteServer" -filepath "C:\Users\test\Desktop\remotely run
scripts\1.ps1"
I am getting an error
The term 'C:\Users\test\Desktop\remotely run scripts\2.ps1 is not recognized as the name of a cmdlet, function,
I have the main script which is call 1.ps1
the other script is called 2.ps1
Here are the scripts
1.ps1 contains this code &("C:\Users\test\Desktop\remotely run scripts\2.ps1")
2.ps1 contains this code new-item -type file c:\itworksagain.txt
The command which i am using is as follows
invoke-command -computer "remoteServer" -filepath "C:\Users\test\Desktop\remotely run
scripts\1.ps1"
I am getting an error
The term 'C:\Users\test\Desktop\remotely run scripts\2.ps1 is not recognized as the name of a cmdlet, function,