{"id":52143,"date":"2009-10-28T00:01:00","date_gmt":"2009-10-28T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2009\/10\/28\/hey-scripting-guy-what-improvements-does-windows-powershell-2-0-have\/"},"modified":"2009-10-28T00:01:00","modified_gmt":"2009-10-28T00:01:00","slug":"hey-scripting-guy-what-improvements-does-windows-powershell-2-0-have","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-what-improvements-does-windows-powershell-2-0-have\/","title":{"rendered":"Hey, Scripting Guy! What Improvements Does Windows PowerShell 2.0 Have?"},"content":{"rendered":"<p><!-- AddThis Button BEGIN --><a class=\"addthis_button\" href=\"http:\/\/www.addthis.com\/bookmark.php?v=250&amp;pub=scriptingguys\"><img decoding=\"async\" alt=\"Bookmark and Share\" src=\"http:\/\/s7.addthis.com\/static\/btn\/v2\/lg-share-en.gif\" width=\"125\" height=\"16\"><\/a>     <!-- AddThis Button END --><\/p>\n<p class=\"Readeraidonly\">(<strong>Editor&rsquo;s note<\/strong>: Portions of today&#8217;s Hey, Scripting Guy! Blog post are excerpted from the Microsoft Press book, <i>Windows PowerShell 2.0 Best Practices<\/i> by Ed Wilson which is now <a href=\"http:\/\/bit.ly\/1NBxZ0\">available for pre-order<\/a>.)<br><\/p>\n<p><a title=\"#1\" name=\"#1\"><\/a><font size=\"2\"><img decoding=\"async\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"><\/font><\/p>\n<p class=\"MsoNormal\">Hey, Scripting Guy! I am curious about some of the new features of Windows PowerShell 2.0. I know that all of the old cmdlets from Windows PowerShell 1.0 are still around, but have there been any improvements? <\/p>\n<p class=\"MsoNormal\">&#8212; MB<\/p>\n<p class=\"MsoNormal\"><img decoding=\"async\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\">Hello MB, <\/p>\n<p class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. Today I am listening to <a href=\"http:\/\/en.wikipedia.org\/wiki\/Die_Zauberflote\"><font face=\"Segoe\">Die Zauberflote<\/font><\/a> on my Zune and sipping a cup of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Gyokuro\"><font face=\"Segoe\">Gyokuro green tea<\/font><\/a>. It has a light delicate taste. I put a little lemon grass in the infuser and a fresh cinnamon stick in my cup. When brewing a pot of Gyokuro tea, it is important to not allow it to steep for more than five minutes or else the tea will begin to taste grassy. If the tea is allowed to steep for more than eight minutes, it will begin to taste bitter&mdash;which is a shame given the fine nature of the tea. For some reason Gyokuro tea goes well with Mozart. Of course, to really set things off, you need an <a href=\"http:\/\/en.wikipedia.org\/wiki\/ANZAC_biscuit\"><font face=\"Segoe\">ANZAC biscuit<\/font><\/a> to go along with the cup of tea. <\/p>\n<p class=\"MsoNormal\">Several of the cmdlets in Windows PowerShell 2.0 have added new parameters. Perhaps the most immediately useful parameter is the <b>&ndash;ComputerName<\/b><i> <\/i>parameter that allows working with computers in a remote fashion. These modified cmdlets are listed here.<\/p>\n<p class=\"MsoNormal\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><b>Get-EventLog<\/b>: Gets the events in an event log, or a list of the event logs, on the local or remote computers. In the following command we use the <b>&ndash;ComputerName<\/b><i> <\/i>with the <b>Get-EventLog<\/b> cmdlet to allow us to retrieve the most recent event from the application log on a remote computer named <b>berlin<\/b>. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Get-EventLog -ComputerName berlin -LogName application -Newest 1<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span>Get-Process: Gets the processes that are running on the local computer or a remote computer. In the following command, we use the new <b>&ndash;ComputerName<\/b><i> <\/i>with the <b>Get-Process<\/b> cmdlet to obtain a listing of the processes currently running on a remote computer named <b>berlin<\/b>. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Get-Process -ComputerName berlin<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><b>Get-Service<\/b>: Gets the services on a local or remote computer. By using the <b>&ndash;ComputerName<\/b><i> <\/i>parameter with the <b>Get-Service<\/b> cmdlet, we can get a listing of the status of all the services that are defined on a remote computer named <b>berlin<\/b>. This line of code is shown here. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Get-Service -ComputerName berlin<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span>&middot;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><\/span><\/span><b>Set-Service<\/b>: Starts, stops, and suspends a service, and changes its properties. The <b>Set-Service<\/b> cmdlet has been updated to include the <b>&ndash;ComputerName<\/b><i> <\/i>parameter as well. As seen here, we use the new switch to connect to a remote computer named <b>berlin<\/b> and to change the startup type of the service to manual. Because this is modifying system state, we also decide to use the <b>&ndash;Confirm<\/b> switch to ensure we are working with both the correct computer and the correct service. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Set-Service -ComputerName berlin -Name bits -StartupType manual &ndash;Confirm<\/p>\n<p><\/font><\/span><\/p>\n<p>The <strong>&ndash;credential<\/strong> parameter was present in Windows PowerShell 1.0 in only one cmdlet, <strong>Get-WmiObject<\/strong><i>. <\/i>This parameter allows for the use of alternate credentials when making remote connections. This switch has been added to several cmdlets such as <strong>Add-Content<\/strong><i> <\/i>and <strong>Get-Content<\/strong>. However, when I tested this by trying to access a file on a remote computer, it came back with an error as shown here: <\/p>\n<p><img decoding=\"async\" title=\"Image of error message\" alt=\"Image of error message\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/october\/hey1028\/hsg-10-28-09-01.jpg\" width=\"650\" height=\"297\"><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/october\/hey1028\/hsg-10-28-09-01.jpg\"><\/a><\/p>\n<p class=\"MsoNormal\">We can investigate this by examining the capabilities of the providers. First we need to see what types of capabilities the providers could support. To do this we use the <b>GetValues()<\/b> static method from the <b>System.Enum<\/b> .NET Framework class. The <b>GetValues()<\/b> method takes one argument, the name of the .NET Framework class from which it is to retrieve the enumeration values. The <b>System.Management.Automation.Provider.ProviderCapabilities<\/b><i> <\/i>class contains the enumeration values we are interested in. The code that obtains these values is shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">[enum]::getValues(&ldquo;System.Management.Automation.Provider.ProviderCapabilities&#8221;)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">We obtain the following list of provider capabilities: <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">None<br>Include<br>Exclude<br>Filter<br>ExpandWildcards<br>ShouldProcess<br>Credentials<br>Transactions<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">Now that we have a listing of the capabilities available to the Windows PowerShell providers, we need to see which default Windows PowerShell 2.0 providers support the <b>Credentials<\/b> capability. To see this, we can use the <b>Get-PSProvider<\/b> cmdlet. As seen here, only one of the default Windows PowerShell 2.0 providers supports the use of capabilities:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">Get-PSProvider<br>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Capabilities<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>Drives<br>&#8212;-<span>&nbsp;&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;&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;<br>Alias<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess<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>{Alias}<br>Environment<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess<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>{Env}<br>FileSystem<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Filter, ShouldProcess<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{C, D, dle, apw&#8230;}<br>Function<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>{Function}<br>Registry<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess, Transactions<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>{HKLM, HKCU, HKCR}<br>Variable<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess<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>{Variable}<br>Certificate<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ShouldProcess<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>{cert, certCU}<br>WSMan<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Credentials<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;&nbsp; <\/span>{WSMan}<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">The <b>&ndash;credential<\/b> parameter will work only if a provider supports it. Because cmdlets like <b>Add-Content<\/b> are designed to work on any Windows PowerShell drive, the <b>&ndash;credential<\/b><i> <\/i>parameter was added. The WSMan default, <b>PSProvider<\/b>, supports the use of credentials, but none of the other default <b>PSProviders<\/b> does so. If you have loaded the <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?displaylang=en&amp;FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d\"><font face=\"Segoe\">Remote Server Administration Tools (RSAT)<\/font><\/a>, the Active Directory provider supports credentials. This is shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-PSProvider -PSProvider activeDirectory | Format-List *<\/p>\n<p>ImplementingType : Microsoft.ActiveDirectory.Management.Provider.ADProvider<br>HelpFile<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Microsoft.ActiveDirectory.Management.dll-Help.xml<br>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: ActiveDirectory<br>PSSnapIn<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>ModuleName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Microsoft.ActiveDirectory.Management<br>Module<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Microsoft.ActiveDirectory.Management<br>Description<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Capabilities<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Include, Exclude, Filter, ShouldProcess, Credentials<br>Home<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Drives<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: {AD}<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">In addition to the <b>&ndash;credential<\/b><i> <\/i>and the <b>&ndash;computername<\/b><i> <\/i>parameters, the cmdlets have been upgraded with additional parameters as well. For example, the <b>Get-Process<\/b> cmdlet has a new switch called <b>FileVersionInfo<\/b>. This switched parameter will display file version information for a specific process or all processes. In the example seen here, the file version information for a process named <b>conhost<\/b> is shown:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-Process -FileVersionInfo -Name conhost<\/p>\n<p>ProductVersion<span>&nbsp;&nbsp; <\/span>FileVersion<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>FileName<br>&#8212;&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;&#8211;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<br>6.1.7600.16385<span>&nbsp;&nbsp; <\/span>6.1.7600.1638&#8230; C:Windowssystem32conhost.exe<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">If your troubleshooting of a process requires additional information, you may wish to use the <b>&ndash;module<\/b> switched parameter. When the <b>&ndash;module<\/b> switch is used, DLL files and other modules that make up the process are displayed:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-Process -module -Name conhost<\/p>\n<p><span>&nbsp;&nbsp; <\/span>Size(K) ModuleName<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>FileName<br><span>&nbsp;&nbsp; <\/span>&#8212;&#8212;- &#8212;&#8212;&#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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8211;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>348 conhost.exe<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1708 ntdll.dll<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><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>C:WindowsSYSTEM32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1148 kernel32.dll<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>428 KERNELBASE.dll<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1060 MSCTF.dll<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;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>2052 ole32.dll<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>1208 RPCRT4.dll<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>860 OLEAUT32.dll<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><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>C:Windowssystem32&#8230;<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>60 CRYPTBASE.dll<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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>C:Windowssystem32&#8230;<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">The <b>Get-Service<\/b> cmdlet has been upgraded with the <b>&ndash;DependentServices<\/b> switch and the <b>&ndash;RequiredServices<\/b> switch. The use of these two switches can be useful when you are trying to determine if a service can be disabled or set to manual. This is illustrated here: <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-Service -Name wudfsvc<\/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>wudfsvc <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>Windows Driver Foundation &#8211; User-mo&#8230;<\/p>\n<p><br>PS C:&gt; Get-Service -Name wudfsvc -RequiredServices<\/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>PlugPlay<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Plug and Play<br>Running<span>&nbsp; <\/span>WudfPf<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>User Mode Driver Frameworks Platfor&#8230;<\/p>\n<p><br>PS C:&gt; Get-Service -Name wudfsvc -DependentServices<\/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>WbioSrvc<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>Windows Biometric Service<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">The <b>Get-EventLog<\/b> cmdlet has been upgraded with a number of new parameters. In Windows PowerShell 1.0, you could display the contents of an event log as shown here:<\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-EventLog -LogName application<\/p>\n<p><span>&nbsp;&nbsp; <\/span>Index Time<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>EntryType<span>&nbsp;&nbsp; <\/span>Source<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>InstanceID Message<br><span>&nbsp;&nbsp; <\/span>&#8212;&#8211; &#8212;-<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;<span>&nbsp;&nbsp; <\/span>&#8212;&#8212;<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>&#8212;&#8212;&#8212;- &#8212;&#8212;-<br><span>&nbsp;&nbsp;&nbsp; <\/span>1205 Oct 22 14:14<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1204 Oct 22 12:14<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1203 Oct 22 10:14<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1202 Oct 22 08:14<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1201 Oct 22 07:13<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1200 Oct 22 07:08<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073750020 License Acti&#8230;<br><span>&nbsp;&nbsp;&nbsp; <\/span>1199 Oct 22 06:38<span>&nbsp; <\/span>Information Software Protecti&#8230;<span>&nbsp;&nbsp; <\/span>1073<\/font><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Editor&rsquo;s note: Portions of today&#8217;s Hey, Scripting Guy! Blog post are excerpted from the Microsoft Press book, Windows PowerShell 2.0 Best Practices by Ed Wilson which is now available for pre-order.) Hey, Scripting Guy! I am curious about some of the new features of Windows PowerShell 2.0. I know that all of the old cmdlets [&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":[3,45],"class_list":["post-52143","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-scripting-guy","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>(Editor&rsquo;s note: Portions of today&#8217;s Hey, Scripting Guy! Blog post are excerpted from the Microsoft Press book, Windows PowerShell 2.0 Best Practices by Ed Wilson which is now available for pre-order.) Hey, Scripting Guy! I am curious about some of the new features of Windows PowerShell 2.0. I know that all of the old cmdlets [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52143","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=52143"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52143\/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=52143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=52143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=52143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}