Author | Shawn Melton (@wsmelton), wsmelton.github.io |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaOperatingSystem on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaOperatingSystem.
Gets operating system information from the server.
Gets operating system information from the server and returns as an object.
Get-DbaOperatingSystem
[[-ComputerName] <DbaInstanceParameter[]>]
[[-Credential] <PSCredential>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaOperatingSystem
Returns information about the local computer's operating system
PS C:\> Get-DbaOperatingSystem -ComputerName sql2016
Returns information about the sql2016's operating system
PS C:\> $wincred = Get-Credential ad\sqladmin
PS C:\> 'sql2016', 'sql2017' | Get-DbaOperatingSystem -Credential $wincred
Returns information about the sql2016 and sql2017 operating systems using alternative Windows credentials
PS C:\> Get-Content .\servers.txt | Get-DbaOperatingSystem
Returns information about all the servers operating system that are stored in the file. Every line in the file can only contain one hostname for a server.
Target computer(s). If no computer name is specified, the local computer is targeted
Alias | cn,host,Server |
Required | False |
Pipeline | true (ByValue) |
Default Value | $env:COMPUTERNAME |
Alternate credential object to use for accessing the target computer(s).
Alias | |
Required | False |
Pipeline | false |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |