Examples/dsc_configuration.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
$ConfigurationData = @{ AllNodes = @( @{ NodeName = 'localhost' PSDscAllowPlainTextPassword = $True } ) } $pass = (convertto-securestring -asplaintext -force 'vagrant') $cred = (New-Object System.Management.Automation.PSCredential ('vagrant', $pass)) configuration default { param ( $ComputerName = 'localhost' ) Import-DscResource -Module NuGet node $ComputerName { NuGet default { PackageSource = "$ENV:SYSTEMDRIVE\Modules" Name = 'Modules' Port = 81 APIKey = 'myapikey' AllowNugetPackagePush = $true AllowPackageOverwrite = $true } PSRepo default { Ensure = 'Present' Name = 'Modules' PublishUri = 'http://localhost:81/' SourceUri = 'http://localhost:81/nuget' InstallPolicy = 'trusted' PSDscRunAsCredential = $cred } NuGet packages { PackageSource = "$ENV:SYSTEMDRIVE\Packages" Name = 'Packages' Port = 82 APIKey = 'myapikey' AllowNugetPackagePush = $true AllowPackageOverwrite = $true } PackageRepo default { Ensure = 'Present' Name = 'Packages' ProviderName = 'Nuget' SourceUri = 'http://localhost:82/nuget' InstallPolicy = 'Trusted' PSDscRunAsCredential = $cred } PackageRepo choco { Ensure = 'Present' Name = 'chocolatey' ProviderName = 'chocolatey' SourceUri = 'http://chocolatey.org/api/v2/' InstallPolicy = 'Trusted' PSDscRunAsCredential = $cred } Nuget_Module Steroids { Ensure = 'Present' Name = 'ISESteroids' ProviderName = 'PSGallery' Version = '2.3.0.64' PSDscRunAsCredential = $cred }#> Nuget_Package git { Ensure = 'Present' Name = 'git' ProviderName = 'chocolatey' Version = '2.7.4' PSDscRunAsCredential = $cred }#> Nuget_Package sublime { Ensure = 'Present' Name = 'sublimetext3' ProviderName = 'chocolatey' Version = '3.0.0.3103' PSDscRunAsCredential = $cred } } } |