Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Configuration myChocoConfig
  2. {
  3.  
  4.    Import-DscResource -Module cChoco  
  5.    Node Win10Test
  6.    {
  7.       LocalConfigurationManager
  8.       {
  9.           DebugMode = 'ForceModuleImport'
  10.       }
  11.  
  12.       cChocoPackageInstaller installWinDirStat
  13.       {
  14.         Ensure = 'Present'
  15.         Name        = "windirstat"
  16.       }
  17.  
  18.    }
  19. }
  20.  
  21.  
  22.  
  23. Write-Host "Creating mofs"
  24. myChocoConfig  -OutputPath .\firstTestMof
  25.  
  26. Write-Host "Starting CimSession"
  27. $cred=Get-Credential -UserName DOMAIN\USER -Message 'gimme yo password bitch'
  28. $cim = New-CimSession -ComputerName Win10Test -Credential $cred
  29.  
  30. Write-Host "Writing config"
  31. Set-DscLocalConfigurationManager -CimSession $cim -Path .\firstTestMof -Verbose
  32.  
  33. # read the config settings back to confirm
  34. Get-DscLocalConfigurationManager -CimSession $cim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement