Created
August 3, 2016 17:45
Star
You must be signed in to star a gist
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 FeatureNetCore | |
{ | |
Import-DscResource -ModuleName PSDesiredStateConfiguration; | |
Node localhost | |
{ | |
File DestinationFolder | |
{ | |
Ensure = "Present" | |
DestinationPath = $Node.Destination | |
Type = 'Directory' | |
Force = $true | |
PsDscRunAsCredential = [PSCredential]::New("USERNAME", ("SUPERNICEPASSWORD" | ConvertTo-SecureString -AsPlainText -Force)) | |
} | |
} | |
} | |
configuration ScriptTest | |
{ | |
Import-DscResource -ModuleName xPSDesiredStateConfiguration; | |
Node localhost | |
{ | |
Script Test | |
{ | |
GetScript = {@{}} | |
SetScript = {} | |
TestScript = {return $true} | |
PsDscRunAsCredential = [PSCredential]::New("USERNAME", ("SUPERNICEPASSWORD" | ConvertTo-SecureString -AsPlainText -Force)) | |
} | |
} | |
} | |
configuration Nest | |
{ | |
FeatureNetCore FeatureNetCore {} | |
ScriptTest ScriptTest {} | |
} | |
$data = @{ | |
AllNodes = @( | |
@{ | |
NodeName = "localhost" | |
PsDscAllowPlainTextPassword = $true | |
} | |
) | |
} | |
Nest -ConfigurationData $data | |
cat .\Nest\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:27:36 | |
@GenerationHost=WINDOWS10TH2 | |
*/ | |
instance of MSFT_Credential as $MSFT_Credential1ref | |
{ | |
Password = "SUPERNICEPASSWORD"; | |
UserName = "USERNAME"; | |
}; | |
instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref | |
{ | |
ResourceID = "[File]DestinationFolder::[FeatureNetCore]FeatureNetCore"; | |
PsDscRunAsCredential = $MSFT_Credential1ref; | |
Type = "Directory"; | |
Ensure = "Present"; | |
SourceInfo = "::7::9::File"; | |
DestinationPath = NULL; | |
Force = True; | |
ModuleName = "PSDesiredStateConfiguration"; | |
ModuleVersion = "0.0"; | |
ConfigurationName = "Nest"; | |
}; | |
instance of MSFT_Credential as $MSFT_Credential2ref | |
{ | |
Password = "SUPERNICEPASSWORD"; | |
UserName = "USERNAME"; | |
}; | |
instance of MSFT_ScriptResource as $MSFT_ScriptResource1ref | |
{ | |
ResourceID = "[Script]Test::[ScriptTest]ScriptTest"; | |
PsDscRunAsCredential = $MSFT_Credential2ref; | |
GetScript = "@{}"; | |
TestScript = "return $true"; | |
SourceInfo = "::24::9::Script"; | |
SetScript = ""; | |
ModuleName = "PSDesiredStateConfiguration"; | |
ModuleVersion = "0.0"; | |
ConfigurationName = "Nest"; | |
}; | |
instance of OMI_ConfigurationDocument | |
{ | |
Version="2.0.0"; | |
MinimumCompatibleVersion = "2.0.0"; | |
CompatibleVersionAdditionalProperties= {"Omi_BaseResource:ConfigurationNa | |
me"}; | |
Author="guitarrapc"; | |
GenerationDate="08/03/2016 11:27:36"; | |
GenerationHost="WINDOWS10TH2"; | |
Name="Nest"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment