Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Trapping Variables Within a PowerShell Script in Orchestrator

$
0
0

Summary: Get data from Windows Powershell in Orchestrator for debugging.

Hey, Scripting Guy! Question Is there an easy way to troubleshoot a Windows PowerShell script in Orchestrator so I can see if the data is $Null or is the right type?

Hey, Scripting Guy! Answer Leverage the Export-Clixml cmdlet within the script against the object in question:

$SomethingNotWorking=GET-CONTENT (C:\somefile.txt)

$SomethingNotWorking | EXPORT-CLIXML C:\debug\something.txt

Then in Windows PowerShell, rebuild the variable to examine it outside of the script:

[xml]$SomethingNotWorking=(GET-CONTENT C:\debug\something.txt)

$SomethingNotWorking | GET-MEMBER


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>