April 19, 2017 at 8:04 pm #69010
Using Window2012 R2 Powershell 5.0 – Push Server
Attempting to Copy a file to a Server using DSC the target nose is Powershell 4.0
Would like to eventually use Powershell DSC to upgrade from 4.0 to 5.0 on a number of targets
Thought I would try some simple first
Here is the code:
[String]$Computername = 'Localhost'
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
ConfigurationModeFrequencyMins = 15
ConfigurationMode = "ApplyAndAutoCorrect"
RefreshMode = "Push"
RebootNodeIfNeeded = $false
AllowModuleOverwrite = $true
Ensure = 'Present'
SourcePath = '\\SomeServerName\d$\Data\Powershell5.0\Win8.1AndW2K12R2-KB3134758-x64.msu'
DestinationPath = 'C:\SomeDirectory'
Type = 'Directory'
Recurse = $true
Here is the MOF file created:
instance of MSFT_FileDirectoryConfiguration as $MSFT_FileDirectoryConfiguration1ref
ResourceID = "[File]MonitoringInstallationFiles";
Type = "Directory";
Ensure = "Present";
DestinationPath = "C:\\SomeFolder";
ModuleName = "PSDesiredStateConfiguration";
SourceInfo = "C:\\Users\\MyLoginName\\DSC-CopyKB.ps1::22::9::File";
Recurse = True;
SourcePath = "\\\\PushServer\\d$\\Data\\Powershell5.0\\Win8.1AndW2K12R2-KB3134758-x64.msu";
ModuleVersion = "1.0";
instance of OMI_ConfigurationDocument
GenerationHost=" PushServer ";
I have removed the lines as stated by Mike F Robbins article
ConfigurationName = "CopyKB";
MinimumCompatibleVersion = "1.0.0";
I still get the error:
Undefined property ActionAfterReboot
At line:20, char:2
Could not retrieve the Local Configuration Manager settings.
+ CategoryInfo : SyntaxError: (root/Microsoft/...gurationManager:String) , CimException
+ FullyQualifiedErrorId : MiClientApiError_Failed
April 24, 2017 at 1:49 pm #69382
I'm not sure DSC makes a great software distribution tool – there are certainly other, better ways to distribute installers. But in your case, it appears that something's putting the CIM repo into an odd state. I've not run into that.
You must be logged in to reply to this topic.