Created
August 3, 2016 17:41
-
-
Save guitarrapc/ca7e9a813685134a5e902426f9a58a9c 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 SameConfiguration | |
{ | |
Import-DscResource -ModuleName PSDesiredStateConfiguration; | |
Import-DscResource -ModuleName xPSDesiredStateConfiguration; | |
Node localhost | |
{ | |
File DestinationFolder | |
{ | |
Ensure = "Present" | |
DestinationPath = $Node.Destination | |
Type = 'Directory' | |
Force = $true | |
} | |
xScript Test | |
{ | |
GetScript = {@{}} | |
SetScript = {} | |
TestScript = {return $true} | |
PsDscRunAsCredential = [PSCredential]::New("USERNAME", ("SUPERNICEPASSWORD" | ConvertTo-SecureString -AsPlainText -Force)) | |
} | |
} | |
} | |
$data = @{ | |
AllNodes = @( | |
@{ | |
NodeName = "localhost" | |
PsDscAllowPlainTextPassword = $true | |
} | |
) | |
} | |
SameConfiguration -ConfigurationData $data | |
cat .\SameConfiguration\localhost.mof |
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
/* | |
@TargetNode='localhost' | |
@GeneratedBy=guitarrapc | |
@GenerationDate=08/03/2016 11:12:40 | |
@GenerationHost=WINDOWS10TH2 | |
*/ | |
instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref | |
{ | |
ResourceID = "[File]DestinationFolder"; | |
Type = "Directory"; | |
Ensure = "Present"; | |
DestinationPath = NULL; | |
Force = True; | |
ModuleName = "PSDesiredStateConfiguration"; | |
SourceInfo = "::8::9::File"; | |
ModuleVersion = "0.0"; | |
ConfigurationName = "SameConfiguration"; | |
}; | |
instance of MSFT_Credential as $MSFT_Credential1ref | |
{ | |
Password = "SUPERNICEPASSWORD"; | |
UserName = "USERNAME"; | |
}; | |
instance of MSFT_xScriptResource as $MSFT_xScriptResource1ref | |
{ | |
ResourceID = "[xScript]Test"; | |
PsDscRunAsCredential = $MSFT_Credential1ref; | |
GetScript = "@{}"; | |
TestScript = "return $true"; | |
SourceInfo = "::16::9::xScript"; | |
SetScript = ""; | |
ModuleName = "xPSDesiredStateConfiguration"; | |
ModuleVersion = "3.12.0.0"; | |
ConfigurationName = "SameConfiguration"; | |
}; | |
instance of OMI_ConfigurationDocument | |
{ | |
Version="2.0.0"; | |
MinimumCompatibleVersion = "2.0.0"; | |
CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationNa | |
me"}; | |
Author="guitarrapc"; | |
GenerationDate="08/03/2016 11:12:40"; | |
GenerationHost="WINDOWS10TH2"; | |
Name="SameConfiguration"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment