Created
September 4, 2013 13:32
-
-
Save gpduck/6437000 to your computer and use it in GitHub Desktop.
This allows plain text passwords to be supplied in DSC configurations. Be aware it puts the password in plain text in c:\windows\system32\configuration\current.mof (and possibly other places)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$CfgData =@{ | |
AllNodes =@( | |
@{ | |
NodeName = $Env:Computername; | |
PSDscAllowPlainTextPassword = $true; | |
} | |
) | |
} | |
configuration TestFile { | |
param ($Cred) | |
node $env:computername { | |
File Test { | |
SourcePath = "\\server\share\test.txt" | |
DestinationPath = "c:\dest\test.txt" | |
Credential = $cred | |
} | |
} | |
} | |
TestFile -cred (get-credential) -configurationData $CfgData | |
Start-DSCConfiguration -path .\TestFile -ComputerName $Env:Computername | wait-job | receive-job |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment