{"id":176,"date":"2018-06-28T08:14:16","date_gmt":"2018-06-28T08:14:16","guid":{"rendered":"http:\/\/robinplomp.com\/?p=176"},"modified":"2018-06-28T13:06:21","modified_gmt":"2018-06-28T13:06:21","slug":"multiple-powershell-outputs-within-ivanti-automation","status":"publish","type":"post","link":"https:\/\/robinplomp.com\/?p=176","title":{"rendered":"Multiple PowerShell outputs within Ivanti Automation"},"content":{"rendered":"<p><a href=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"193\" height=\"127\" title=\"image\" align=\"left\" style=\"float: left; display: inline; background-image: none;\" alt=\"image\" src=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image_thumb-6.png\" border=\"0\"><\/a>Ivanti Automation (formally known as RES Automation) and PowerShell work very well together. By using PowerShell from within Ivanti Automation we are able to talk to any system that utilize a REST full API. <\/p>\n<p>The Task for Powershell does only allow for all the screen output of a script to be placed in one Automation parameter. To divide this output into multiple parameters the data had to be splited in Automation or in Ivanti Identity Director. <\/p>\n<p><a href=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"358\" height=\"278\" title=\"image\" style=\"margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;\" alt=\"image\" src=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image_thumb-3.png\" border=\"0\"><\/a><\/p>\n<p><!--more--><\/p>\n<p>Since the release of Ivanti Automation 2018.1 (current version is 2018.1.1) it is now possible to place the output of multiple PowerShell variables in to various Automation parameters. <\/p>\n<p>To do this from within your script you have to declare your parameter the following way:<\/p>\n<p><strong>$global<em>:ParameterName<\/em><\/strong><em> <\/em><\/p>\n<p>Experienced PowerShell users will recognize this notation for a Global variable in Powershell. Importing thing to remember when using this the ParameterName is case sensitive so it has to match how it is used in Automation. When your ParameterName includes special characters or even spaces please read this post. <a href=\"http:\/\/robinplomp.com\/?p=161\">Using special characters in PowerShell Variables<\/a><\/p>\n<p>This code is just an example how you can use this feature, there many different use cases that could apply.<\/p>\n<p><a href=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"192\" title=\"image\" style=\"margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;\" alt=\"image\" src=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image_thumb-4.png\" border=\"0\"><\/a><\/p>\n<p>If I execute this code with Ivanti Automation I get the following output.<\/p>\n<p><a href=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image-5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"171\" title=\"image\" style=\"margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;\" alt=\"image\" src=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image_thumb-5.png\" border=\"0\"><\/a><\/p>\n<p><\/p>\n<p><a href=\"http:\/\/robinplomp.com\/wp-content\/uploads\/2018\/06\/image-4.png\"><br \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ivanti Automation (formally known as RES Automation) and PowerShell work very well together. By using PowerShell from within Ivanti Automation we are able to talk to any system that utilize a REST full API. The Task for Powershell does only allow for all the screen output of a script to be placed in one Automation &hellip; <a href=\"https:\/\/robinplomp.com\/?p=176\" class=\"more-link\">Lees verder <span class=\"screen-reader-text\">Multiple PowerShell outputs within Ivanti Automation<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,14,24],"tags":[27,29,11,28,25],"class_list":["post-176","post","type-post","status-publish","format-standard","hentry","category-ivanti-automation","category-powershell","category-res-one-automation","tag-automation","tag-ivanti","tag-powershell","tag-res","tag-variables"],"_links":{"self":[{"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinplomp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=176"}],"version-history":[{"count":2,"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/posts\/176\/revisions"}],"predecessor-version":[{"id":183,"href":"https:\/\/robinplomp.com\/index.php?rest_route=\/wp\/v2\/posts\/176\/revisions\/183"}],"wp:attachment":[{"href":"https:\/\/robinplomp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinplomp.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinplomp.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}