Enterprise PowerShell Scripting Bootcamp by Brenton J.W. Blawat

Enterprise PowerShell Scripting Bootcamp by Brenton J.W. Blawat

Author:Brenton J.W. Blawat [Blawat, Brenton J.W.]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2017-05-18T04:00:00+00:00


Note

To follow the examples in this chapter, it is recommended that you run the examples on a Windows Server 2012 system. Some of the cmdlets referenced in this chapter are not available in PowerShell 2.0, workstation operating systems, or in operating systems older than Server 2008 R2.

Windows features

When you are trying to determine the function of a Windows server, typically you start by evaluating the Windows features and roles. PowerShell has multiple methods to query server features and roles on a system. The get-WindowsFeature cmdlet, available in Server 2008 R2 and higher, provides a simple display of the features and roles installed on a system. The get-WindowsFeature cmdlet has multiple properties including the DisplayName property, Name property, Installed property, Parent property, and the InstallState property. The DisplayName property is the friendly name of the service. The Name property is the short version of DisplayName. The Installed property is a true or false property that reflects if the feature is installed. The InstallState property provides information as to whether the feature is installed, removed, or available for installation.

To query a server for the installed server features, you can perform the following:

get-WindowsFeature | where {$_.Installed -eq $true} | Select DisplayName, InstallState, Parent



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.