File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
source/DSCResources/DSC_ScheduledTask Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010- ` azure-pipelines.yml `
1111 - Remove ` windows-2019 ` images fixes [ #451 ] ( https://github.com/dsccommunity/ComputerManagementDsc/issues/451 ) .
1212- Module manifest: Set ` CmdletsToExport ` to ` '*' ` to satisfy HQRM tests.
13+ - ScheduledTask
14+ - Removed Undefined from ScheduledTask enum
15+ Fixes [ Issue #460 ] ( https://github.com/dsccommunity/ComputerManagementDsc/issues/460 ) .
1316
1417### Fixed
1518
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ namespace ScheduledTask
1313 }
1414 public enum StateChange : uint
1515 {
16- Undefined = 0,
1716 OnConnectionFromLocalComputer = 1,
1817 OnDisconnectFromLocalComputer = 2,
1918 OnConnectionFromRemoteComputer = 3,
@@ -2127,7 +2126,14 @@ function Get-CurrentResource
21272126 EventSubscription = $trigger.Subscription
21282127 EventValueQueries = ConvertTo-HashtableFromTaskNamedValuePairCollection - Array $trigger.ValueQueries
21292128 Delay = ConvertTo-TimeSpanStringFromScheduledTaskString - TimeSpan $trigger.Delay
2130- StateChange = [System.String ][ScheduledTask.StateChange ][System.UInt32 ] $trigger.StateChange # Cast to integer first to allow casting to enum with null
2129+ }
2130+
2131+ if ($trigger.StateChange )
2132+ {
2133+ $result.Add (' StateChange' , [System.String ][ScheduledTask.StateChange ][System.UInt32 ] $trigger.StateChange )
2134+ }
2135+ else {
2136+ $result.Add (' StateChange' , $null )
21312137 }
21322138
21332139 if (
You can’t perform that action at this time.
0 commit comments