Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Is Invoke-Expression mandatory to call a powershell script from within another ps1 ?

$
0
0

Hi, 

I have 2 powershell scripts and am trying to call a ps1 from within another one. Both the files are in the same directory.

Ex: 

a.ps1b.ps1

write-output "Tech-net".\a.ps1

When I executed the b.ps1 script from my local it worked fine, but when i ran it from the server it threw the below error 

".\a.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"




Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>