Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Test-DscNamespace ($ComputerName = $env:COMPUTERNAME) {
- if (Get-CimInstance -ComputerName $ComputerName -Namespace root\Microsoft\Windows -ClassName __NAMESPACE -Filter "name='DesiredStateConfiguration'" -ErrorAction SilentlyContinue) {
- $true
- } else {
- $false
- }
- }
- $Servers = "Demo-Ad","WC7-1","WS8R2-1","WS8R2-2","WSR2-3-WMF50","WSR2-1"
- foreach ($server in $Servers) {
- New-Object -TypeName PSObject -Property @{
- PSComputerName = $Server
- IsPowerShell4 = Test-DscNamespace -ComputerName $Server
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement