Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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
- Joined: Fri Jan 25, 2019 4:05 pm
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 s
o 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.
- Posts: 13793
- Joined: Tue May 22, 2007 9:57 am
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.