en-us/sthTools.psm1-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml"> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Test-sthWindowsUpdateRebootRequired</command:name> <command:verb>Test</command:verb> <command:noun>sthWindowsUpdateRebootRequired</command:noun> <maml:description> <maml:para>Function for testing computers on pending reboot after update installation and, if needed, rebooting them. </maml:para> </maml:description> </command:details> <maml:description> <maml:para>Function for testing local and remote computers on pending reboot after update installation. </maml:para> <maml:para>Checks Component Based Servicing registry key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending and Windows Update registry key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired. </maml:para> <maml:para>Also have the possibility to initiate reboot on remote computers (not local) which need it by specifying -Restart and -YesRestart parameters. Does not initiate reboot on local computer (can be specified as 'localhost', 'hostname' or 'hostname.domainname.com') </maml:para> <maml:para>By default function skips computers, that can not be accessed. You can see, which computers were skipped by specifying -ShowInaccessible. </maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Test-sthWindowsUpdateRebootRequired</maml:name> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Names of computers to test. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Restart</maml:name> <maml:Description> <maml:para>Restart computers which need it (remote only). </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>YesRestart</maml:name> <maml:Description> <maml:para>Explicit reboot confirmation. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowInaccessible</maml:name> <maml:Description> <maml:para>Show inaccessible computers in results. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="True (ByValue)" position="0" aliases="none"> <maml:name>ComputerName</maml:name> <maml:Description> <maml:para>Names of computers to test. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>localhost</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>Restart</maml:name> <maml:Description> <maml:para>Restart computers which need it (remote only). </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>YesRestart</maml:name> <maml:Description> <maml:para>Explicit reboot confirmation. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="none"> <maml:name>ShowInaccessible</maml:name> <maml:Description> <maml:para>Show inaccessible computers in results. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Test-sthWindowsUpdateRebootRequired ComputerName ComponentBasedServicing WindowsUpdate ------------ ----------------------- ------------- localhost False False </dev:code> <dev:remarks> <maml:para/> <maml:para>Get information about localhost. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>Test-sthWindowsUpdateRebootRequired -ComputerName comp-1, comp-2, localhost ComputerName ComponentBasedServicing WindowsUpdate ------------ ----------------------- ------------- comp-1 False False comp-2 True True localhost False False </dev:code> <dev:remarks> <maml:para/> <maml:para>Get information from several computers by specifying -ComputerName parameter. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title> -------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>'comp-1', 'comp-2', 'localhost' | Test-sthWindowsUpdateRebootRequired ComputerName ComponentBasedServicing WindowsUpdate ------------ ----------------------- ------------- comp-1 False False comp-2 True True localhost False False </dev:code> <dev:remarks> <maml:para/> <maml:para>Get information from several computers by piping names of the computers into the function. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title> <dev:code>Test-sthWindowsUpdateRebootRequired -ComputerName comp-1,comp-2,localhost,Inaccessiblecomputer -ShowInaccessible ComputerName ComponentBasedServicing WindowsUpdate ------------ ----------------------- ------------- comp-1 False False comp-2 True True localhost False False Inaccessiblecomputer Inaccessible Inaccessible </dev:code> <dev:remarks> <maml:para/> <maml:para>Get information from several computers by specifying -ComputerName. </maml:para> <maml:para/> <maml:para>Also get information about inaccessible computers by specifying -ShowInaccessible parameter. (By default inaccessible computers are silently skipped.) </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title> <dev:code>Test-sthWindowsUpdateRebootRequired -ComputerName comp-1,comp-2,localhost -Restart -YesRestart ComputerName ComponentBasedServicing WindowsUpdate ------------ ----------------------- ------------- comp-1 False False comp-2 True True localhost True True </dev:code> <dev:remarks> <maml:para/> <maml:para>Get information from several computers and restart computers that needs it. (does not restart localhost) In this example comp-2 will be restarted. </maml:para> <maml:para/> <maml:para>(Both -Restart and -YesRestart parameters must be specified.) </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Remove-sthPreviousModuleVersions</command:name> <command:verb>Remove</command:verb> <command:noun>sthPreviousModuleVersions</command:noun> <maml:description> <maml:para>Function for uninstalling previous versions of modules, installed from PowerShell Gallery. </maml:para> </maml:description> </command:details> <maml:description> <maml:para>Function for uninstalling previous versions of modules, installed from PowerShell Gallery. </maml:para> <maml:para>Useful for removing previous versions of existing modules, after updating them to current versions with Update-Module cmdlet. </maml:para> <maml:para>You can specify one or more module names in -ModuleName parameter. </maml:para> <maml:para>If -ModuleName parameter is omitted, function removes previous versions of all modules installed from PowerShell Gallery. </maml:para> <maml:para>Function uses Write-Output cmdlet, so that you can redirect output to text file, for example: Remove-sthPreviousModuleVersions -ModuleName AzureRM.profile, AzureRM.Resources >> c:\log.txt </maml:para> <maml:para>Function also supports -WhatIf and -Confirm parameters. </maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Remove-sthPreviousModuleVersions</maml:name> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="none"> <maml:name>ModuleName</maml:name> <maml:Description> <maml:para>Module names, for which to uninstall previous versions. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>*</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet. </maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run. </maml:para> </maml:Description> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="false" variableLength="true" globbing="true" pipelineInput="false" position="0" aliases="none"> <maml:name>ModuleName</maml:name> <maml:Description> <maml:para>Module names, for which to uninstall previous versions. </maml:para> </maml:Description> <command:parameterValue required="true" variableLength="false">String[]</command:parameterValue> <dev:type> <maml:name>String[]</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>*</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="cf"> <maml:name>Confirm</maml:name> <maml:Description> <maml:para>Prompts you for confirmation before running the cmdlet. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> <command:parameter required="false" variableLength="true" globbing="false" pipelineInput="False" position="named" aliases="wi"> <maml:name>WhatIf</maml:name> <maml:Description> <maml:para>Shows what would happen if the cmdlet runs. The cmdlet is not run. </maml:para> </maml:Description> <command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue> <dev:type> <maml:name>SwitchParameter</maml:name> <maml:uri /> </dev:type> <dev:defaultValue>False</dev:defaultValue> </command:parameter> </command:parameters> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>Remove-sthPreviousModuleVersions -ModuleName AzureRM.profile, AzureRM.Resources Module: AzureRM.profile Latest version: 3.1.0 Removing version: 3.0.1 Removing version: 3.0.0 Module: AzureRM.Resources Latest version: 4.1.0 Removing version: 4.0.1 Removing version: 4.0.0 </dev:code> <dev:remarks> <maml:para/> <maml:para>Remove previous versions of modules AzureRM.profile and AzureRM.Resources. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>Remove-sthPreviousModuleVersions</dev:code> <dev:remarks> <maml:para/> <maml:para>Remove previous versions of all modules, installed from PowerShell Gallery. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title> -------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>Remove-sthPreviousModuleVersions >> c:\logs\log.txt</dev:code> <dev:remarks> <maml:para/> <maml:para>Remove previous versions of all modules, installed from PowerShell Gallery and redirect output to text file for logging purposes. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title> <dev:code>Remove-sthPreviousModuleVersions -ModuleName AzureRM.profile, AzureRM.Resources -WhatIf What if: Module: AzureRM.profile Latest version: 3.1.0 Removing Version: 3.0.1 Removing Version: 3.0.0 What if: Module: AzureRM.Resources Latest version: 4.1.0 Removing Version: 4.0.1 Removing Version: 4.0.0 </dev:code> <dev:remarks> <maml:para/> <maml:para>Displays the names and versions of modules, that will be uninstalled, when the command is invoked without -WhatIf parameter. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title> <dev:code>Remove-sthPreviousModuleVersions -ModuleName AzureRM.profile, AzureRM.Resources -Confirm Confirm Are you sure you want to perform this action? Module: AzureRM.profile Latest version: 3.1.0 Removing Version: 3.0.1 Removing Version: 3.0.0 [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Module: AzureRM.profile Latest version: 3.1.0 Removing version: 3.0.1 Removing version: 3.0.0 Confirm Are you sure you want to perform this action? Module: AzureRM.Resources Latest version: 4.1.0 Removing Version: 4.0.1 Removing Version: 4.0.0 [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y Module: AzureRM.Resources Latest version: 4.1.0 Removing version: 4.0.1 Removing version: 4.0.0 </dev:code> <dev:remarks> <maml:para/> <maml:para>Request confirmation before uninstalling previous versions of modules. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> </command:examples> </command:command> <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"> <command:details> <command:name>Get-sthLDAPComputersByOperatingSystem</command:name> <command:verb>Get</command:verb> <command:noun>sthLDAPComputersByOperatingSystem</command:noun> <maml:description> <maml:para>Function for getting all Enabled computer objects from Active Directory using ADSI and grouping them by Operating System using custom object properties: XP, Seven, Eight and Ten. </maml:para> </maml:description> </command:details> <maml:description> <maml:para>Function queries current domain naming context of Active Directory using ADSI and returns custom object that contains Enabled computer objects grouped by Operating System. </maml:para> <maml:para>This object's contents can be used as input for cmdlets and functions that influence multiple computers and take computer names or other information as parameters' values. </maml:para> <maml:para>Returned custom object consists of four main properties: XP, Seven, Eight and Ten. These properties contain objects representing computers with all the properties, that was returned by ADSI query. </maml:para> <maml:para/> <maml:para>You can use this function as: </maml:para> <maml:para>$Comps = Get-sthLDAPComputersByOperatingSystem </maml:para> <maml:para>Then you can get all "Windows XP" computers by typing: $Comps.XP </maml:para> <maml:para>"Windows 7" computers: $Comps.Seven </maml:para> <maml:para>"Windows 8" and "Windows 8.1" computers: $Comps.Eight </maml:para> <maml:para>"Windows 10" computers: $Comps.Ten </maml:para> <maml:para>By default these computers objects show properties that Get-ADComputer cmdlet without -Properties parameter would show. You can get all computer properties as: $Comps.Ten | Format-List * </maml:para> <maml:para/> <maml:para>Also this custom object contains two additional properties, that is created by means of types file: All and Summary. </maml:para> <maml:para/> <maml:para>All property contains all computer objects from four main properties: XP, Seven, Eight and Ten, so that you can reference all computers at once. </maml:para> <maml:para>Summary property contains here-string that consists of names of all computers from four main properties. This property is used by default custom view, defined in format file. </maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Get-sthLDAPComputersByOperatingSystem</maml:name> </command:syntaxItem> </command:syntax> <command:parameters/> <command:examples> <command:example> <maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title> <dev:code>$Comps = Get-sthLDAPComputersByOperatingSystem $Comps </dev:code> <dev:remarks> <maml:para/> <maml:para>Displays summary information about all enabled computer objects returned by query. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title> <dev:code>$Comps = Get-sthLDAPComputersByOperatingSystem $Comps.Ten </dev:code> <dev:remarks> <maml:para/> <maml:para>Displays "Windows 10" computer objects. </maml:para> <maml:para/> <maml:para>By default it shows only DistinguishedName, DNSHostName, Name, ObjectClass, GUID, SamAccountName and SID properties. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title> -------------------------- EXAMPLE 3 --------------------------</maml:title> <dev:code>$Comps = Get-sthLDAPComputersByOperatingSystem $Comps.Ten | Format-List * </dev:code> <dev:remarks> <maml:para/> <maml:para>Displays "Windows 10" computer objects. </maml:para> <maml:para/> <maml:para>By specifying "*" as Format-List cmdlet parameter command returns all computer objects' properties. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 4 --------------------------</maml:title> <dev:code>$Comps = Get-sthLDAPComputersByOperatingSystem $Comps.Ten.Name </dev:code> <dev:remarks> <maml:para/> <maml:para>Displays names of all enabled "Windows 10" computers. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> <command:example> <maml:title>-------------------------- EXAMPLE 5 --------------------------</maml:title> <dev:code>$Comps = Get-sthLDAPComputersByOperatingSystem $Comps.Ten.Name | Test-sthWindowsUpdateRebootRequired </dev:code> <dev:remarks> <maml:para/> <maml:para>Tests if some of the "Windows 10" computers requre reboot after installing updates. </maml:para> <maml:para/> <maml:para/> </dev:remarks> </command:example> </command:examples> </command:command> </helpItems> |