{"id":16361,"date":"2010-11-30T00:01:00","date_gmt":"2010-11-30T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/11\/30\/use-powershell-to-export-and-to-import-repetitive-commands\/"},"modified":"2010-11-30T00:01:00","modified_gmt":"2010-11-30T00:01:00","slug":"use-powershell-to-export-and-to-import-repetitive-commands","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-to-export-and-to-import-repetitive-commands\/","title":{"rendered":"Use PowerShell to Export and to Import Repetitive Commands"},"content":{"rendered":"<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size: 10pt\">Summary:<\/span><\/b><span style=\"font-size: 10pt\"> Learn how to use Windows PowerShell to import and to export command history and avoid writing scripts.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" \/><\/span><\/span>Hey, Scripting Guy! I have worked with other systems where I was able to keep track of the commands that I typed into the console. The neat thing about that was that I could export my commands, and import them into another console and replay my command history. This was a great way to perform repetitive configuration tasks without having to write a script. Is this something that can be accomplished with Windows PowerShell?<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&#8212; SW<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><span style=\"font-size: 10pt\"><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" \/><\/span><\/span>Hello SW, Microsoft Scripting Guy Ed Wilson here. Windows PowerShell has great command history features. By learning how to use the command history features of Windows PowerShell, many repetitive tasks can be automated. <\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\"><\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">Portions of today&rsquo;s Hey, Scripting Guy! Blog post are adapted from material in my <\/span><a href=\"http:\/\/www.amazon.com\/Windows-PowerShell-Best-Practices-Microsoft\/dp\/0735626464\/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1290463673&amp;sr=1-2\"><i><span style=\"font-size: 10pt\"><span style=\"color: #0000ff\">Windows PowerShell 2.0 Best Practices book<\/span><\/span><\/i><\/a><span style=\"font-size: 10pt\">, published by Microsoft Press in December 2009. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">Much administrative work with Windows PowerShell consists of typing a series of commands at the console. Whether it is editing the registry, stopping various processes and services, the configuration work has to be replicated to several different servers to make sure a consistent operating environment. In the past such duplication of effort would require creating scripts. If the commands to be duplicated are a series of commands typed at the console, you can use the command history mechanism to replace the need for a script. To do this, use the <b>Get-History<\/b> cmdlet and export the commands to an xml file as seen here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">Get-History | Export-Clixml -Path C:\\fso\\history.xml<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">The result is an XML file that represents all the commands which have been typed at the console. The resulting xml file is seen in the following figure.<\/span><\/p>\n<p class=\"Num-Caption\"><span style=\"font-size: x-small\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/0181.HSG-11-30-10-01.jpg\" border=\"0\" \/><\/span><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><\/p>\n<p><span style=\"font-size: 10pt\">After you have created a command history xml file, you can import the commands from the xml file by using the <b>Import-Clixml<\/b> cmdlet. You pipeline the results of the <b>Import-Clixml<\/b> cmdlet to the <b>Add-History<\/b> cmdlet to add the commands back to the command history. The trick is to use the <b>&ndash;passthru<\/b> switch<span>&nbsp; <\/span>so that the commands will go to both the <b>Add-History<\/b> cmdlet and to the <b>ForEach-Object<\/b> cmdlet as well. In the <b>Foreach-Object<\/b> cmdlet you use the <b>Invoke-History<\/b> cmdlet to run each command that is in the history. The commands are shown here, as are the results of running them. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Import-Clixml -Path C:\\fso\\history.xml | Add-History -Passthru |<br \/>&gt;&gt; ForEach-Object { Invoke-History }<br \/>&gt;&gt;<br \/><span>&nbsp;<\/span>if(!(test-path -path c:\\fso4)) { new-item c:\\fso4 -ItemType directory }<\/p>\n<p><span>&nbsp;&nbsp;&nbsp; <\/span>Directory: C:\\<\/p>\n<p>Mode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>LastWriteTime<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Length Name<br \/>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212; &#8212;-<br \/>d&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1\/9\/2009<span>&nbsp; <\/span>12:33 AM<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>fso4<br \/>Get-Command &gt;&gt; C:\\fso4\\commands.txt<br \/>notepad C:\\fso4\\commands.txt<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">This technique will work remotely by using the <b>Invoke-Command<\/b> cmdlet. The thing to keep in mind is that the path statement is relative to the computer that is the target, not the computer that is executing the command. If you do not keep this in mind, then an error such as the one seen in the following figure appears.<\/span><\/p>\n<p class=\"Num-Caption\"><span style=\"font-size: x-small\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/2627.HSG-11-30-10-02.jpg\" border=\"0\" \/><\/span><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><\/p>\n<p><span style=\"font-size: 10pt\"><\/span><\/p>\n<p><span style=\"font-size: 10pt\">If you copy the file to the target machine first, and adjust your command line, the import and execute history technique works well. The good thing about Windows PowerShell, is that you can use an UNC path with the <b>Copy-Item<\/b> cmdlet. It is this feature that actually makes the technique worthwhile because it enables you to easily move a file to a remote computer. This is shown here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Copy-Item C:\\fso\\history.xml \\\\berlin\\c$\\fso<br \/>PS C:\\&gt; Import-Clixml -Path C:\\fso\\history.xml | Add-History -Passthru | ForEach<br \/>-Object { Invoke-History }<br \/><span>&nbsp;<\/span>if(!(test-path -path c:\\fso4)) { new-item c:\\fso4 -ItemType directory }<\/p>\n<p><span>&nbsp;&nbsp;&nbsp; <\/span>Directory: C:\\<\/p>\n<p>Mode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>LastWriteTime<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Length Name<br \/>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212; &#8212;-<br \/>d&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1\/9\/2009<span>&nbsp; <\/span>12:40 AM<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>fso4<br \/>Get-Command &gt;&gt; C:\\fso4\\commands.txt<br \/>notepad C:\\fso4\\commands.txt<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">Fan out commands are commands that are launched from a central computer and run against a number of remote computers. One way to perform this technique is to use the <b>Invoke-Command<\/b> cmdlet as seen here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Invoke-Command -Computer berlin,vista -Script `<br \/>&gt;&gt; {&#8220;$env:computername $(get-date)&#8221; }<br \/>&gt;&gt;<br \/>VISTA 01\/09\/2009 08:31:42<br \/>BERLIN 01\/09\/2009 08:31:47<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">You can use fan out commands by specifying an array of computer names for the <i>computername<\/i> parameter for many of the cmdlets. The problem with this approach is the results are almost useless. An example may show the issue that is involved. In the command below, the <b>Get-Service<\/b> cmdlet is used to obtain service configuration information from two computers. The first is a computer named Vista, and the second one is a server named Berlin. As you can see from the partial output, copied here, the results of the command are merged, and there is no column that shows the computer name that the result is associated with. The results are interesting because you can quickly look at the service name between two computers and easily see divergent configurations. The fan out command and a truncated result set is seen here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -ComputerName Vista, Berlin<\/p>\n<p>Status<span>&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<br \/>&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<br \/>Running<span>&nbsp; <\/span>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions Services &#8230;<br \/>Running<span>&nbsp; <\/span>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions Services &#8230;<br \/>Running<span>&nbsp; <\/span>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<br \/>Stopped<span>&nbsp; <\/span>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<br \/>Stopped <span>&nbsp;<\/span>ALG<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Layer Gateway Service<br \/>Stopped<span>&nbsp; <\/span>ALG<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Layer Gateway Service<br \/>Stopped<span>&nbsp; <\/span>Appinfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Information<br \/>Stopped<span>&nbsp; <\/span>Appinfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Information<br \/>Stopped<span>&nbsp; <\/span>AppMgmt<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Management<br \/>Stopped<span>&nbsp; <\/span>AppMgmt<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Management<br \/>Stopped<span>&nbsp; <\/span>AudioEndpointBu&#8230; Windows Audio Endpoint Builder<br \/>Stopped<span>&nbsp; <\/span>AudioEndpointBu&#8230; Windows Audio Endpoint Builder<br \/>Stopped<span>&nbsp; <\/span>Audiosrv<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio<br \/>Stopped<span>&nbsp; <\/span>Audiosrv<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio<br \/>Running<span>&nbsp; <\/span>BFE<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Base Filtering Engine<br \/>Running<span>&nbsp; <\/span>BFE<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Base Filtering Engine<br \/>Running<span>&nbsp; <\/span>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Transfer Ser&#8230;<br \/>Stopped<span>&nbsp; <\/span>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Transfer Ser&#8230;<br \/>Stopped<span>&nbsp; <\/span>Browser<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Computer Browser<br \/>Running<span>&nbsp; <\/span>Browser<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Computer Browser<br \/>&gt;&gt;&gt; Results trimmed &gt;&gt;&gt;<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">You can see from the results of the <b>Get-Service<\/b> command that the <b>AeLookupSvc<\/b> is running on the first computer, and stopped on the second computer. To check this, it is simple to use the <b>Get-Service<\/b> cmdlet to connect to each of the computers, and to check the status of the service.<\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -Name AeLookupSvc -computer vista<\/p>\n<p>Status<span>&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<br \/>&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>&#8212;&#8212;&#8212;&#8211;<br \/>Stopped<span>&nbsp; <\/span>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<\/p>\n<p>PS C:\\&gt; Get-Service -Name AeLookupSvc -computer Berlin<\/p>\n<p>Status<span>&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<br \/>&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<br \/>Running<span>&nbsp; <\/span>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">You might think that the first instance of the service name belongs to the computer that is listed first. As you can see, the <b>AeLookupSvc<\/b> is running on Berlin, but is stopped on Vista. This is the same order that is seen in the original output. However, the Vista computer was listed first in the fan out command. Perhaps this means that the second computer results are listed first, and the first computer results are listed second&mdash;a Last In First Out (LIFO) operation. Before assuming such to be the case, you have to check another service. In the output from the original fan out command, the <b>Bits<\/b> service was listed first as running, and second as stopped. To see the status of the <b>Bits<\/b> service on Berlin and on Vista, you can use the following two commands. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -Name Bits -computer berlin<\/p>\n<p>Status<span>&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<br \/>&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<br \/>Stopped<span>&nbsp; <\/span>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Transfer Ser&#8230;<\/p>\n<p>PS C:\\&gt; Get-Service -Name Bits -computer Vista<\/p>\n<p>Status<span>&nbsp;&nbsp; <\/span>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;<\/span>DisplayName<br \/>&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<br \/>Running<span>&nbsp; <\/span>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Transfer Ser&#8230;<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">You can see that the <b>Bits<\/b> service is stopped on Berlin, and is running on Vista. The results of using <b>Get-Service<\/b> as a fan out command by supplying an array of computer names to the <i>computername<\/i> parameter brings back interesting results, but results that are meaningless when it comes to checking the exact status of a service on a remote computer. As a best practice, you should pipeline the results of the fan out command to a <b>Format-Table<\/b> cmdlet and choose the <b>machineName<\/b> property. The value of <b>displayName<\/b> property is the same value that is seen in the Services MMC in the name column. The command and a truncated output are shown here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -ComputerName berlin,vista | format-table name, status, mach<br \/>inename, displayName -AutoSize<\/p>\n<p>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Status MachineName DisplayName<br \/>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212; &#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8211;<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>Running vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions&#8230;<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions&#8230;<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<br \/>ALG<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Layer Gateway&#8230;<br \/>ALG<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Layer Gateway&#8230;<br \/>Appinfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Information<br \/>Appinfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Information<br \/>AppMgmt<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Management<br \/>AppMgmt<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Management<br \/>AudioEndpointBuilder <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio Endpoint Bu&#8230;<br \/>AudioEndpointBuilder<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio Endpoint Bu&#8230;<br \/>Audiosrv<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio<br \/>Audiosrv<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Audio<br \/>BFE<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Base Filtering Engine<br \/>BFE<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Base Filtering Engine<br \/>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Tr&#8230;<br \/>BITS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>Running vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Background Intelligent Tr&#8230;<br \/>Browser<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running vista<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Computer Browser<br \/>Browser<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped berlin<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Computer Browser<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">Because the value of the <b>displayName<\/b> property is frequently quite long, it does not always easily fit within the confines of an 80 column display. If you have it selected early in the order of the properties to be selected by the <b>Format-Table<\/b> cmdlet, you will probably end up with several columns not being displayed. This is shown here. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -ComputerName berlin,vista | format-table name, displayname,<br \/><span>&nbsp;<\/span>status, machinename -AutoSize<\/p>\n<p>WARNING: 2 columns do not fit into the display and were removed.<\/p>\n<p>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<br \/>&#8212;-<span>&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>&#8212;&#8212;&#8212;&#8211;<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions Services Application<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Additions Services Application<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experience<\/span><\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><span style=\"font-size: 10pt\">As you can see, this defeats the purpose of choosing the <b>machineName<\/b> property in the first place, if it is left off because it does not fit on the display. To correct this potential problem, it is a best practice to always select the property that uses the longest values to be displayed for the last position in the command. In this way, you allow Windows PowerShell to truncate the property value rather than filling up the screen with information, you could easily infer from a truncated display. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">The other solution to the problem of the shrinking display output would be not to use the <i>autosize<\/i> parameter of the <b>Format-Table<\/b> cmdlet. You could use the <i>wrap<\/i> parameter instead. When this parameter is used, single line entries are allowed to wrap and to form multiple lines. Depending on the information that you are looking for, this output can be either helpful, or annoying. Here is an example of using the wrap parameter. <\/span><\/p>\n<p class=\"CodeBlock\" style=\"padding-left: 30px\"><span style=\"font-size: 10pt\"><span style=\"font-family: Lucida Sans Typewriter\">PS C:\\&gt; Get-Service -ComputerName berlin,vista | format-table name, displayname,<br \/><span>&nbsp;<\/span>status, machinename -Wrap<\/p>\n<p>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>DisplayName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Status MachineName<br \/>&#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212; &#8212;&#8212;&#8212;&#8211;<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Add<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running vista<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>itions Services App<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>lication<br \/>1-vmsrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Virtual Machine Add<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Running berlin<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>itions Services App<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>lication<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experie<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;<\/span>Running berlin<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>nce<br \/>AeLookupSvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Application Experie<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Stopped vista<br \/><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>nce<\/span><\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p class=\"Readeraidonly\"><span style=\"font-size: 10pt\">At this point in the discussion, you may be thinking that you can really resolve this problem of the truncated display output by using both the <i>autosize<\/i> and the <i>wrap<\/i> parameters. This would enable the output to maximize the display real estate (the function of <i>autosize<\/i>) and also to allow for multiline wrapping (the function of wrap). This never works, but does not generate an error. Windows PowerShell will give priority to the <i>autosize<\/i> parameter and ignore the wrap parameter. It does not matter in which order the two parameters are typed; the <i>wrap<\/i> parameter will be ignored. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">SW, that is all there is to importing and exporting Windows PowerShell command history. To Script or Not to Script week will continue tomorrow when I will talk about how to work with Active Directory Domain Services. <\/span><\/p>\n<p><span style=\"font-size: 10pt\">I invite you to follow me on <\/span><a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingguystwitter\"><span style=\"font-size: 10pt\"><span style=\"color: #0000ff\">Twitter<\/span><\/span><\/a><span style=\"font-size: 10pt\"> or <\/span><a href=\"http:\/\/bit.ly\/scriptingguysfacebook\"><span style=\"font-size: 10pt\"><span style=\"color: #0000ff\">Facebook<\/span><\/span><\/a><span style=\"font-size: 10pt\">. If you have any questions, send email to me at <\/span><a target=\"_blank\" href=\"mailto:scripter@microsoft.com\"><span style=\"font-size: 10pt\"><span style=\"color: #0000ff\">scripter@microsoft.com<\/span><\/span><\/a><span style=\"font-size: 10pt\"> or post them on the <\/span><a target=\"_blank\" href=\"http:\/\/bit.ly\/scriptingforum\"><span style=\"font-size: 10pt\"><span style=\"color: #0000ff\">Official Scripting Guys Forum<\/span><\/span><\/a><span style=\"font-size: 10pt\">. See you tomorrow. Until then, peace.<\/span><\/p>\n<p><span style=\"font-size: 10pt\">&nbsp;<\/span><\/p>\n<p><b><span style=\"font-size: 10pt\">Ed Wilson, Microsoft Scripting Guy<\/span><\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Summary: Learn how to use Windows PowerShell to import and to export command history and avoid writing scripts. &nbsp; Hey, Scripting Guy! I have worked with other systems where I was able to keep track of the commands that I typed into the console. The neat thing about that was that I could export [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[51,3,4,45],"class_list":["post-16361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-getting-started","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; Summary: Learn how to use Windows PowerShell to import and to export command history and avoid writing scripts. &nbsp; Hey, Scripting Guy! I have worked with other systems where I was able to keep track of the commands that I typed into the console. The neat thing about that was that I could export [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=16361"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/16361\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=16361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=16361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=16361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}