Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Commit

Permalink
(MODULES-5623) Handle DateTime values correctly
Browse files Browse the repository at this point in the history
DateTime values should be passed along as System.DateTime objects and not pure strings, this fixes issues with `starttime` property not being handled correctly.
  • Loading branch information
ananace committed May 15, 2018
1 parent fe6933d commit 828aba1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/provider/templates/dsc/invoke_dsc_resource.ps1.erb
Expand Up @@ -35,6 +35,8 @@ $invokeParams = @{
<%- name = p.name.to_s.gsub(/^dsc_/,'')
if name == 'ensure' && dsc_invoke_method == 'test'
value = "\'#{resource.parameters[:ensure].default.to_s}\'"
elsif p.mof_type == 'datetime'
value = "[System.DateTime]#{format_dsc_value(p.value)}"
elsif p.mof_type == 'MSFT_Credential'
value = "[PSCustomObject]#{format_dsc_value(p.value)} | new-pscredential"
elsif p.mof_is_embedded? && p.mof_type != 'MSFT_KeyValuePair'
Expand Down

0 comments on commit 828aba1

Please sign in to comment.