Skip to content

Instantly share code, notes, and snippets.

@joelwiesmann
Created October 30, 2017 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelwiesmann/16cbb8c3fdf71570ddf6056ab559bbd5 to your computer and use it in GitHub Desktop.
Save joelwiesmann/16cbb8c3fdf71570ddf6056ab559bbd5 to your computer and use it in GitHub Desktop.
Object inactivation with WorkflowCommander
# 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