Hello. I am having some issues when calling a PowerShell script from within VBA. The issue seems that the input parameters to the script do not seem to have a global scope as they do when you call the script from within PowerShell itself. Can someone confirm this and tell me if there is a workaround to this? Or do I just rewrite my script like one would write a app in a language such as C# and pass the input parameters from entry point within the script?
This is the string used when calling the script:
powershell.exe -executionPolicy Bypass -NoExit -NoLogo -mta -WindowStyle Normal -file "\\ServerName\Share\Path\CalledScript.ps1" -LoginID "SomeID" -ComputerName "Computer1" -OutputPath "\\ServerName\Share\Path\" -Title "Computer1" -Verbose
Thanks,