Created
October 30, 2017 07:13
-
-
Save joelwiesmann/16cbb8c3fdf71570ddf6056ab559bbd5 to your computer and use it in GitHub Desktop.
Object inactivation with WorkflowCommander
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
# Open connection with predefined profile | |
$ae = new-aeConnection -profile client4321 | |
# Option 1: use search-result as input for what objects should be inactivated. Here we take | |
# all SCRI objects below path /SET_INACTIVE matching the name DEMO_* | |
$objects = (search-aeObject -ae $ae -path /SET_INACTIVE -type SCRI -name DEMO_*).name | |
# OR... | |
# Option 2: use a text file as input. | |
$objects = get-content c:\temp\objectlist.txt | |
# OR... | |
# Option 3: Use a VARAs "key"-columncontent to define what objects to proceed. | |
$objects = (get-aeVARA -ae $ae -name VARA.INACTIVE.LIST).key | |
# OR... | |
# Option 4: Use static values | |
$objects = 'JOBS.OBJA','JOBS.OBJB','JOBS.OBJC' | |
# OR… | |
# … get data from XML, webservices, databases, CSVs and so on and so forth often with just a single line of code | |
# Iterate through the list and set object to inactive | |
foreach ($object in $objects) { | |
$changeMe = open-aeObject -ae $ae -name $object -readwrite | |
$changeMe.header().setActive($false) | |
save-aeObject -ae $ae -object $changeme -close | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment