Looking for some help with Add-JobTracker

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 10 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ryan.simpson
Posts: 2
Last visit: Wed Aug 10, 2016 7:14 am

Looking for some help with Add-JobTracker

Post by ryan.simpson »

I am trying to build a GUI frontend for an existing script.

The GUI presents various buttons/input fields to build the appropriate named parameters to send to the script.

What I cannot figure out how to do, is invoke the script from Add-JobTracker -JobScript {

THIS WORKS GREAT:
Add-JobTracker -Name "$JobName" -JobScript {
& "C:ScriptsSomeScript.ps1" -GUI -Source:Server01a -Scope:SharesOnly -Created }

However, I have arguments in variables.. Running in the console I can do this:
& $scriptName $scriptArguments

Where $scriptname = "C:ScriptsSomeScript.ps1"
and $scriptArguments = " -GUI -Source:Server01a" -Scope:SharesOnly"

How can I invoke a & $scriptName $scriptArguments
with Add-JobTracker?
This topic is 10 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked