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:
Configuration CopyKB
{
param (
[String]$Computername = ‘Localhost’
)
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
Node $Computername
{
LocalConfigurationManager
{
ConfigurationModeFrequencyMins = 15
ConfigurationMode = "ApplyAndAutoCorrect"
RefreshMode = "Push"
RebootNodeIfNeeded = $false
AllowModuleOverwrite = $true
}
File MonitoringInstallationFiles
{
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:
/*
@TargetNode=‘TargetServer’
@GeneratedBy=MyLoginName
@GenerationDate=04/19/2017 09:02:58
@GenerationHost=PushServer
*/
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
{
Version=“2.0.0”;
Author=“MyLoginName”;
GenerationDate=“04/19/2017 09:02:58”;
GenerationHost=" PushServer ";
};
I have removed the lines as stated by Mike F Robbins article
http://mikefrobbins.com/2014/10/30/powershell-desired-state-configuration-error-undefined-property-configurationname/
ConfigurationName = “CopyKB”;
MinimumCompatibleVersion = “1.0.0”;
CompatibleVersionAdditionalProperties= {“Omi_BaseResource:ConfigurationName”};
Name=“CopyKB”;
I still get the error:
Undefined property ActionAfterReboot
At line:20, char:2
Buffer:
7-80BE-E4115BAFE292";
};^
Could not retrieve the Local Configuration Manager settings.
+ CategoryInfo : SyntaxError: (root/Microsoft/…gurationManager:String) , CimException
+ FullyQualifiedErrorId : MiClientApiError_Failed