Created
August 7, 2016 08:58
-
-
Save guitarrapc/453d573ca2bf67e8d2a13c24cc9cf166 to your computer and use it in GitHub Desktop.
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
configuration Absent_PsDscRunAsCredential | |
{ | |
Import-DscResource -Modulename GraniResource | |
Node localhost | |
{ | |
cCredentialManager Absent | |
{ | |
InstanceIdentifier = $Node.InstanceIdentifier | |
Ensure = $Node.Ensure | |
Target = $Node.Target | |
PsDscRunAsCredential = $Node.PsDscRunAsCredential | |
} | |
} | |
} | |
$configurationData = @{ | |
AllNodes = @( | |
@{ | |
NodeName = "localhost" | |
PSDscAllowPlainTextPassword = $true | |
InstanceIdentifier = "JustAnIdentifierToKeepUnique" | |
Ensure = "Absent" | |
Target = "DesiredTargetName" | |
PsDscRunAsCredential = New-Object PSCredential ("administrator", ("SuperExcellntPassword____????1111" | ConvertTo-SecureString -Force -AsPlainText)) | |
} | |
) | |
} | |
Absent_PsDscRunAsCredential -ConfigurationData $configurationData |
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
configuration Present_PsDscRunAsCredential | |
{ | |
Import-DscResource -Modulename GraniResource | |
Node localhost | |
{ | |
cCredentialManager Present | |
{ | |
InstanceIdentifier = $Node.InstanceIdentifier | |
Ensure = $Node.Ensure | |
Target = $Node.Target | |
Credential = $Node.Credential | |
PsDscRunAsCredential = $Node.PsDscRunAsCredential | |
} | |
} | |
} | |
$configurationData = @{ | |
AllNodes = @( | |
@{ | |
NodeName = "localhost" | |
PSDscAllowPlainTextPassword = $true | |
InstanceIdentifier = "JustAnIdentifierToKeepUnique" | |
Ensure = "Present" | |
Target = "DesiredTargetName" | |
Credential = New-Object PSCredential ("PesterTestDummy", ("PesterTestPassword" | ConvertTo-SecureString -Force -AsPlainText)) | |
PsDscRunAsCredential = New-Object PSCredential ("administrator", ("SuperExcellntPassword____????1111" | ConvertTo-SecureString -Force -AsPlainText)) | |
} | |
) | |
} | |
Present_PsDscRunAsCredential -ConfigurationData $configurationData |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment