Advertisement
Guest User

Untitled

a guest
Aug 4th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Function Test-DscNamespace ($ComputerName = $env:COMPUTERNAME) {
  2. if (Get-CimInstance -ComputerName $ComputerName -Namespace root\Microsoft\Windows -ClassName __NAMESPACE -Filter "name='DesiredStateConfiguration'" -ErrorAction SilentlyContinue) {
  3. $true
  4. } else {
  5. $false
  6. }
  7. }
  8.  
  9. $Servers = "Demo-Ad","WC7-1","WS8R2-1","WS8R2-2","WSR2-3-WMF50","WSR2-1"
  10.  
  11. foreach ($server in $Servers) {
  12. New-Object -TypeName PSObject -Property @{
  13. PSComputerName = $Server
  14. IsPowerShell4 = Test-DscNamespace -ComputerName $Server
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement