Created
August 3, 2016 17:48
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 | |
} | |
} | |
} | |
configuration xScriptTest | |
{ | |
Import-DscResource -ModuleName xPSDesiredStateConfiguration; | |
Node localhost | |
{ | |
xScript Test | |
{ | |
GetScript = {@{}} | |
SetScript = {} | |
TestScript = {return $true} | |
PsDscRunAsCredential = [PSCredential]::New("USERNAME", ("SUPERNICEPASSWORD" | ConvertTo-SecureString -AsPlainText -Force)) | |
} | |
} | |
} | |
configuration Nest | |
{ | |
FeatureNetCore FeatureNetCore {} | |
xScriptTest xScriptTest {} | |
} | |
$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:15:21 | |
@GenerationHost=WINDOWS10TH2 | |
*/ | |
instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref | |
{ | |
ResourceID = "[File]DestinationFolder::[FeatureNetCore]FeatureNetCore"; | |
Type = "Directory"; | |
Ensure = "Present"; | |
DestinationPath = NULL; | |
Force = True; | |
ModuleName = "PSDesiredStateConfiguration"; | |
SourceInfo = "::7::9::File"; | |
ModuleVersion = "1.0"; | |
ConfigurationName = "Nest"; | |
}; | |
instance of MSFT_Credential as $MSFT_Credential1ref | |
{ | |
Password = "SUPERNICEPASSWORD"; | |
UserName = "USERNAME"; | |
}; | |
instance of MSFT_xScriptResource as $MSFT_xScriptResource1ref | |
{ | |
ResourceID = "[xScript]Test::[xScriptTest]xScriptTest"; | |
PsDscRunAsCredential = $MSFT_Credential1ref; | |
GetScript = "@{}"; | |
TestScript = "return $true"; | |
SourceInfo = "::23::9::xScript"; | |
SetScript = ""; | |
ModuleName = "xPSDesiredStateConfiguration"; | |
ModuleVersion = "3.12.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:15:21"; | |
GenerationHost="WINDOWS10TH2"; | |
Name="Nest"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment