Hi All,
I have to Execute PS1 script when a button is clicked, if i add the script code to the button so the UI is not responsive for 10 min as the task is huge so i want to execute the script in different/background job.
So at the button i have added below code:
$path = .\Something.ps1
Start-Job -FilePath $path -Name "New Job"
But when i am done compiling it is not working as it is unable to find the script. I dont want to add the script in the same folder where i have compiled EXE.
Please help me with above, any help would be appriciated.
Start-Job New Script
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 3
- Last visit: Fri Oct 11, 2019 11:38 am
Re: Start-Job New Script
You need to use the full path to the script wherever you may have it stored.
There is no way to help you beyond that because we don't have any idea of what your code is or how you "compiled" it.
Be aware that scripts are not compiled, they are "packaged" which just stores the script inside of an EXE and executes the script directly.
There is no way to help you beyond that because we don't have any idea of what your code is or how you "compiled" it.
Be aware that scripts are not compiled, they are "packaged" which just stores the script inside of an EXE and executes the script directly.