Created
May 26, 2023 02:25
-
-
Save Nillth/2037cd3c1f28d9f968bd7a52f0256f4e to your computer and use it in GitHub Desktop.
Toggle Selected NPrinting Publish Tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Connect-NPrinting | |
$Tasks = Get-NPTasks | |
$SelectedTasks = $Tasks |Out-GridView -OutputMode Multiple -Title "Select Tasks" | |
foreach($Task in $SelectedTasks){ | |
$TaskDetails = Invoke-NPRequest -method Get -NPE -Path "tasks/publish/$($Task.id)" | |
$TaskDetails.enabled = $(-not $TaskDetails.enabled) | |
Invoke-NPRequest -method Put -NPE "tasks/publish/$($Task.id)" -Data $TaskDetails | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment