Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get ScheduleTask configuration #62

Closed
spawluk opened this issue May 17, 2016 · 3 comments
Closed

Cannot get ScheduleTask configuration #62

spawluk opened this issue May 17, 2016 · 3 comments
Labels

Comments

@spawluk
Copy link

spawluk commented May 17, 2016

I've wrote resource for scheduled task:

cScheduleTask {Name} #ResourceName
    {
      Ensure                           = "Present"
      TaskName                         = "TaskName"
      Credential                       = $credential
      Execute                          = "{execute}"
      TaskPath                         = "\"
      ScheduledAt                      = @([DateTime]"00:00:00")
      RepetitionIntervalTimeSpanString = @([TimeSpan]::FromMinutes(10).ToString())
      RepetitionDurationTimeSpanString = @([TimeSpan]::MaxValue.ToString())
      Disable                          = $false
      Hidden                           = $false
      WorkingDirectory                 = "{workingDirectory}"
    }

Resource can be created but when I try Get-DscConfiguration I get:

Get-DscConfiguration : GetConfiguration did not succeed.
At line:1 char:1
+ Get-DscConfiguration -CimSession {name} -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_DSCLocalConfigurationManager:root/Microsoft/...gurationManager) [Get-DscConfiguration], CimException
    + FullyQualifiedErrorId : MI RESULT 1,Get-DscConfiguration
    + PSComputerName        : {name}

I also get ERROR in ETW:

Message Unable to cast object of type 'System.String' to type 'System.Collections.IList'.
Parameter name: value 
HResult -2147024809 
StackTrack    at Microsoft.Management.Infrastructure.Internal.Data.CimPropertyOfInstance.set_Value(Object value)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.GetTargetResource(IntPtr resourceConfigurationInstanceHandle, IntPtr nonResourcePropetiesHandle, IntPtr metaConfigHandle, IntPtr regInstanceHandle, IStreamsHandler plugInStreamsHandler, IntPtr& outputInstanceHandle, IntPtr& errorInstanceHandle)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.DscPluginManagedEntryWrapper.Get(IntPtr provContext, IntPtr instance, IntPtr nonResourcePropeties, IntPtr metaConfig, IntPtr regInstance, IntPtr outputInstance, IntPtr extendedError)
@guitarrapc guitarrapc added the bug label May 18, 2016
@guitarrapc
Copy link
Owner

It seems like bug. I will check it.

@guitarrapc
Copy link
Owner

Issue relates to RepetitionIntervalTimeSpanString

@guitarrapc
Copy link
Owner

Fixed.

eefab3d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants