I'm trying to write a desired state configuration that installs a package via PackageManagement (aka OneGet). The package, "notepadplusplus", comes from the Chocolatey repository but I want to use PackageManagement rather than the Chocolatey client. I couldn't find a DSC resource to do it, so I'm using a Script resource.
DSC runs without errors and Notepad++ shows up in the packages list but never actually gets installed (Notepad++.exe
is nowhere on the system).
I'm running on a Windows 10 VM.
Here's a simplified example of what I'm doing. Anyone spot what I'm doing wrong?
dscConfig.ps1
Configuration BuildProvisioning
{
param(
[string[]]$computerName="localhost"
)
Import-DscResource -ModuleName PSDesiredStateConfiguration
Node $computerName
{
Script PackageManagementTest
{
SetScript = {
Get-PackageProvider NuGet -Force | Out-Null
Get-PackageProvider Chocolatey -Force | Out-Null
Install-Package notepadplusplus -Force
}
TestScript = { $false }
GetScript = { @{} }
}
}
}
And here is how I'm kicking it off on the VM
. .\dscConfig.ps1
BuildProvisioning
winrm quickconfig -quiet
Start-DscConfiguration -Verbose -Force -Wait -ComputerName "localhost" -Path ".\BuildProvisioning\"