Explorer/ExecuteRulesetJob.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
param($command) try { # $writer = Get-SRxCustomizationWriter # $writer.Start($command) #Write-Host "---------------------------------" #Write-Host "BEGIN - ExecuteRulesetJob " #Write-Host "---------------------------------" #Import-Module "Microsoft.PowerShell.Management" -DisableNameChecking -Verbose:$false -Force #Import-Module "Microsoft.PowerShell.Utility" -DisableNameChecking -Verbose:$false -Force # Write-Host ($command | FL | Out-String) #Write-Host "command.ts_SourceID = $($command.ts_SourceID)" Initialize-SRxEnv -SourceID $command.ts_SourceID# -LoadModule2 $LoadModule #if ($global:SRxEnv.Exists) { Start-SRxShell -ControlFile $command.ts_ControlFile -isJob } #$global:SRxEnv.SourceTag = $($command.ts_SourceID) $global:SRxEnv.SetCustomProperty("SourceTag", $command.ts_SourceID) #Write-Host "SourceTag = $($global:SRxEnv.SourceTag)" if ($global:SRxEnv.Exists) { Set-SRxCommand -command $command if( $global:SRxEnv.SOP.ts_IsAdmin -and (-not $global:SRxEnv.isStakeHolder)) { $output = New-SRxReport -ControlFile "Invoke-NotImplemented" } else { Connect-SRxSPOService #refresh it $output = New-SRxReport -ControlFile $global:SRxEnv.SOP.ts_ControlFile } } #Write-Host "---------------------------------" #Write-Host "END - ExecuteRulesetJob " #Write-Host "---------------------------------" } catch { Write-Host ($_.Exception.Message) } #$object = [pscustomobject]$command #$object |