diff --git a/DSCResources/MSFT_xComputer/MSFT_xComputer.psm1 b/DSCResources/MSFT_xComputer/MSFT_xComputer.psm1 index 5f31cb0d..003dda5f 100644 --- a/DSCResources/MSFT_xComputer/MSFT_xComputer.psm1 +++ b/DSCResources/MSFT_xComputer/MSFT_xComputer.psm1 @@ -61,6 +61,11 @@ function Set-TargetResource ) ValidateDomainOrWorkGroup -DomainName $DomainName -WorkGroupName $WorkGroupName + + if ($Name -eq 'localhost') + { + $Name = $env:COMPUTERNAME + } if ($Credential) { @@ -215,11 +220,11 @@ function Test-TargetResource [string] $WorkGroupName ) - + Write-Verbose -Message "Validate desired Name is a valid name" - Write-Verbose -Message "Checking if computer name is $Name" - if ($Name -ne $env:COMPUTERNAME) {return $false} + Write-Verbose -Message "Checking if computer name is correct" + if (($Name -ne 'localhost') -and ($Name -ne $env:COMPUTERNAME)) {return $false} ValidateDomainOrWorkGroup -DomainName $DomainName -WorkGroupName $WorkGroupName diff --git a/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1 b/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1 index ac8d62a9..6aeecc97 100644 --- a/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1 +++ b/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1 @@ -40,6 +40,10 @@ function Get-TargetResource [ValidateSet("Present","Absent")] $Ensure = "Present", + [Parameter(Mandatory=$false)] + [System.Boolean] + $Enable, + [Parameter(Mandatory=$false)] [System.Management.Automation.PSCredential] $ExecuteAsCredential @@ -128,6 +132,7 @@ function Get-TargetResource ScheduleType = $returnScheduleType RepeatInterval = $returnInveral ExecuteAsCredential = $task.Principal.UserId + Enable = $task.Settings.Enabled } } } @@ -173,6 +178,10 @@ function Set-TargetResource [ValidateSet("Present","Absent")] $Ensure = "Present", + [Parameter(Mandatory=$false)] + [System.Boolean] + $Enable, + [Parameter(Mandatory=$false)] [System.Management.Automation.PSCredential] $ExecuteAsCredential @@ -195,6 +204,15 @@ function Set-TargetResource } $action = New-ScheduledTaskAction @actionArgs + $settingArgs = @{} + + if ($PSBoundParameters.ContainsKey("Enable")) + { + $settingArgs.Add("Disable", (-not $Enable)) + } + + $setting = New-ScheduledTaskSettingsSet @settingArgs + $date = (Get-Date).Date $startTime = [DateTime]::Parse("$($date.ToShortDateString()) $StartTime") switch ($ScheduleType) @@ -228,7 +246,7 @@ function Set-TargetResource { Write-Verbose -Message "Creating new scheduled task `"$TaskName`"" - $scheduledTask = New-ScheduledTask -Action $action -Trigger $trigger + $scheduledTask = New-ScheduledTask -Action $action -Trigger $trigger -Settings $setting $registerArgs = @{ TaskName = $TaskName TaskPath = $TaskPath @@ -253,7 +271,8 @@ function Set-TargetResource TaskName = $TaskName TaskPath = $TaskPath Action= $action - Trigger = $trigger + Trigger = $trigger + Settings = $setting } if ($PSBoundParameters.ContainsKey("ExecuteAsCredential") -eq $true) { @@ -317,6 +336,10 @@ function Test-TargetResource [ValidateSet("Present","Absent")] $Ensure = "Present", + [Parameter(Mandatory=$false)] + [System.Boolean] + $Enable, + [Parameter(Mandatory=$false)] [System.Management.Automation.PSCredential] $ExecuteAsCredential @@ -370,6 +393,15 @@ function Test-TargetResource return $false } } + + if ($PSBoundParameters.ContainsKey("Enable") -eq $true) + { + if ($Enable -ne ($currentValues.Enable)) + { + Write-Verbose -Message "Enable does not match desired state. Current value: $($currentValues.Enabled) - Desired Vale: $Enable" + return $false + } + } } return $true diff --git a/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.schema.mof b/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.schema.mof index 0d75d9ca..a7952b71 100644 --- a/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.schema.mof +++ b/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.schema.mof @@ -10,5 +10,6 @@ class MSFT_xScheduledTask : OMI_BaseResource [Required, Description("How many units (minutes, hours, days) between each run of this task?")] Uint32 RepeatInterval; [Write, Description("The time of day this task should start at - defaults to 12:00 AM")] string StartTime; [Write, Description("Present if the task should exist, false if it should be removed"), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] string Ensure; + [Write, Description("True if the task should be enabled, false if it should be disabled")] boolean Enable; [Write, Description("The credential this task should execute as. If not specified defaults to running as the local system account"), EmbeddedInstance("MSFT_Credential")] string ExecuteAsCredential; }; diff --git a/README.md b/README.md index a5d641f9..b4c22186 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,10 @@ This DSC Resource allows you to rename a computer and add it to a domain or work All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service. The ""x" in xComputerManagement stands for experimental, which means that these resources will be fix forward and monitored by the module owner(s). -Please leave comments, feature requests, and bug reports in the Q & A tab for this module. +Please leave comments, feature requests, and bug reports in the Issues tab for this module. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. If you would like to modify xComputerManagement module, feel free. When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). @@ -73,6 +76,10 @@ xScheduledTask has the following properties: ### Unreleased +### 1.7.0.0 +*Added support for enabling or disabling scheduled tasks +* The Name parameter resolves to $env:COMPUTERNAME when the value is localhost + ### 1.6.0.0 * Added the following resources: * MSFT_xOfflineDomainJoin resource to join computers to an AD Domain using an Offline Domain Join request file. diff --git a/Tests/Integration/MSFT_xScheduledTask.Config.ps1 b/Tests/Integration/MSFT_xScheduledTask.Config.ps1 index 8d62490b..fcd7f948 100644 --- a/Tests/Integration/MSFT_xScheduledTask.Config.ps1 +++ b/Tests/Integration/MSFT_xScheduledTask.Config.ps1 @@ -99,3 +99,35 @@ Configuration xScheduledTask_Remove } } } + +Configuration xScheduledTask_Enable +{ + Import-DscResource -ModuleName xComputerManagement + node "localhost" { + xScheduledTask xScheduledTask_Remove { + TaskName = "Test task" + TaskPath = "\xComputerManagement\" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $true + Ensure="Present" + } + } +} + +Configuration xScheduledTask_Disable +{ + Import-DscResource -ModuleName xComputerManagement + node "localhost" { + xScheduledTask xScheduledTask_Remove { + TaskName = "Test task" + TaskPath = "\xComputerManagement\" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $false + Ensure="Present" + } + } +} \ No newline at end of file diff --git a/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1 b/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1 index a35605a8..8cf18496 100644 --- a/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1 +++ b/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1 @@ -180,6 +180,50 @@ try } } + Context "A scheduled task exists, and should be enabled" { + $CurrentConfig = "xScheduledTask_Enable" + $ConfigDir = (Join-Path $TestEnvironment.WorkingFolder $CurrentConfig) + $ConfigMof = (Join-Path $ConfigDir "localhost.mof") + + It "should compile a MOF file without error" { + { + . $CurrentConfig -OutputPath $ConfigDir + } | Should Not Throw + } + + It "should apply the MOF correctly" { + { + Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force + } | Should Not Throw + } + + It "should return a compliant state after being applied" { + (Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true + } + } + + Context "A scheduled task exists, and should be disabled" { + $CurrentConfig = "xScheduledTask_Disable" + $ConfigDir = (Join-Path $TestEnvironment.WorkingFolder $CurrentConfig) + $ConfigMof = (Join-Path $ConfigDir "localhost.mof") + + It "should compile a MOF file without error" { + { + . $CurrentConfig -OutputPath $ConfigDir + } | Should Not Throw + } + + It "should apply the MOF correctly" { + { + Start-DscConfiguration -Path $ConfigDir -Wait -Verbose -Force + } | Should Not Throw + } + + It "should return a compliant state after being applied" { + (Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true + } + } + AfterEach { Remove-DscConfigurationDocument -Stage Current, Pending, Previous -Force -Confirm:$false -WarningAction SilentlyContinue } diff --git a/Tests/Unit/MSFT_xComputer.Tests.ps1 b/Tests/Unit/MSFT_xComputer.Tests.ps1 index b0870a24..b3258249 100644 --- a/Tests/Unit/MSFT_xComputer.Tests.ps1 +++ b/Tests/Unit/MSFT_xComputer.Tests.ps1 @@ -54,19 +54,23 @@ try Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} Test-TargetResource -Name $Env:ComputerName -DomainName 'contoso.com' -Credential $Credential | Should Be $true + Test-TargetResource -Name 'localhost' -DomainName 'contoso.com' -Credential $Credential | Should Be $true } It 'Should return True if ComputerName and Workgroup is same as specified' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Workgroup';Workgroup='Workgroup';PartOfDomain=$false}} Mock GetComputerDomain {''} Test-TargetResource -Name $Env:ComputerName -WorkGroupName 'workgroup' | Should Be $true + Test-TargetResource -Name 'localhost' -WorkGroupName 'workgroup' | Should Be $true } It 'Should return True if ComputerName is same and no Domain or Workgroup specified' { Mock Get-WmiObject {[PSCustomObject]@{Domain = 'Workgroup';Workgroup='Workgroup';PartOfDomain=$false}} Mock GetComputerDomain {''} Test-TargetResource -Name $Env:ComputerName | Should Be $true + Test-TargetResource -Name 'localhost' | Should Be $true Mock Get-WmiObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} Test-TargetResource -Name $Env:ComputerName | Should Be $true + Test-TargetResource -Name 'localhost' | Should Be $true } It 'Should return False if ComputerName is not same and no Domain or Workgroup specified' { Mock Get-WmiObject {[PSCustomObject]@{Domain = 'Workgroup';Workgroup='Workgroup';PartOfDomain=$false}} @@ -80,11 +84,13 @@ try Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} Test-TargetResource -Name $Env:ComputerName -DomainName 'adventure-works.com' -Credential $Credential | Should Be $false + Test-TargetResource -Name 'localhost' -DomainName 'adventure-works.com' -Credential $Credential | Should Be $false } It 'Should return False if Workgroup name is not same as specified' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Workgroup';Workgroup='Workgroup';PartOfDomain=$false}} Mock GetComputerDomain {''} Test-TargetResource -Name $Env:ComputerName -WorkGroupName 'NOTworkgroup' | Should Be $false + Test-TargetResource -Name 'localhost' -WorkGroupName 'NOTworkgroup' | Should Be $false } It 'Should return False if ComputerName is not same as specified' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Workgroup';Workgroup='Workgroup';PartOfDomain=$false}} @@ -98,11 +104,13 @@ try Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$false}} Mock GetComputerDomain {''} Test-TargetResource -Name $Env:ComputerName -DomainName 'contoso.com' -Credential $Credential | Should Be $false + Test-TargetResource -Name 'localhost' -DomainName 'contoso.com' -Credential $Credential | Should Be $false } It 'Should return False if ComputerName is in Domain and Workgroup is specified' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} Test-TargetResource -Name $Env:ComputerName -WorkGroupName 'Contoso' -Credential $Credential -UnjoinCredential $Credential | Should Be $false + Test-TargetResource -Name 'localhost' -WorkGroupName 'Contoso' -Credential $Credential -UnjoinCredential $Credential | Should Be $false } It 'Throws if name is to long' { {Test-TargetResource -Name "ThisNameIsTooLong"} | Should Throw @@ -110,6 +118,9 @@ try It 'Throws if name contains illigal characters' { {Test-TargetResource -Name "ThisIsBad<>"} | Should Throw } + It 'Should not Throw if name is localhost' { + {Test-TargetResource -Name "localhost"} | Should Not Throw + } } Context "$($Global:DSCResourceName)\Get-TargetResource" { @@ -198,6 +209,15 @@ try Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$NewName} Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$WorkGroupName} } + It 'Changes only the Domain to new Domain when name is [localhost]' { + Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} + Mock GetComputerDomain {'contoso.com'} + Set-TargetResource -Name 'localhost' -DomainName 'adventure-works.com' -Credential $Credential -UnjoinCredential $Credential | Should BeNullOrEmpty + Assert-MockCalled -CommandName Rename-Computer -Exactly 0 -Scope It + Assert-MockCalled -CommandName Add-Computer -Exactly 1 -Scope It -ParameterFilter {$DomainName} + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$NewName} + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$WorkGroupName} + } It 'Changes only the Domain to new Domain with specified OU' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} @@ -207,6 +227,15 @@ try Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$NewName} Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$WorkGroupName} } + It 'Changes only the Domain to new Domain with specified OU when Name is [localhost]' { + Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} + Mock GetComputerDomain {'contoso.com'} + Set-TargetResource -Name 'localhost' -DomainName 'adventure-works.com' -JoinOU 'OU=Computers,DC=contoso,DC=com' -Credential $Credential -UnjoinCredential $Credential | Should BeNullOrEmpty + Assert-MockCalled -CommandName Rename-Computer -Exactly 0 -Scope It + Assert-MockCalled -CommandName Add-Computer -Exactly 1 -Scope It -ParameterFilter {$DomainName} + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$NewName} + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$WorkGroupName} + } It 'Changes only Domain to Workgroup' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {''} @@ -216,6 +245,15 @@ try Assert-MockCalled -CommandName Add-Computer -Exactly 1 -Scope It -ParameterFilter {$WorkGroupName} Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$DomainName} } + It 'Changes only Domain to Workgroup when Name is [localhost]' { + Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} + Mock GetComputerDomain {''} + Set-TargetResource -Name 'localhost' -WorkGroupName 'Contoso' -UnjoinCredential $Credential | Should BeNullOrEmpty + Assert-MockCalled -CommandName Rename-Computer -Exactly 0 -Scope It + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$NewName} + Assert-MockCalled -CommandName Add-Computer -Exactly 1 -Scope It -ParameterFilter {$WorkGroupName} + Assert-MockCalled -CommandName Add-Computer -Exactly 0 -Scope It -ParameterFilter {$DomainName} + } It 'Changes only ComputerName in Domain' { Mock Get-WMIObject {[PSCustomObject]@{Domain = 'Contoso.com';Workgroup='Contoso.com';PartOfDomain=$true}} Mock GetComputerDomain {'contoso.com'} diff --git a/Tests/Unit/MSFT_xScheduledTask.Tests.ps1 b/Tests/Unit/MSFT_xScheduledTask.Tests.ps1 index cf740719..40594eb2 100644 --- a/Tests/Unit/MSFT_xScheduledTask.Tests.ps1 +++ b/Tests/Unit/MSFT_xScheduledTask.Tests.ps1 @@ -457,8 +457,213 @@ try } } + Context "A scheduled task is enabled and should be disabled" { + $testParams = @{ + TaskName = "Test task" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $false + } + + Mock Get-ScheduledTask { return @{ + Name = $testParams.TaskName + Path = $testParams.TaskPath + Actions = @(@{ + Execute = $testParams.ActionExecutable + Arguments = $testParams.Arguments + }) + Triggers = @(@{ + Repetition = @{ + Duration = $null + Interval = "PT$($testParams.RepeatInterval)M" + } + }) + Settings = @(@{ + Enabled = $true + }) + Principal = @{ + UserId = "SYSTEM" + } + } } + + It "should return present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "should update the scheduled task in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Set-ScheduledTask + } + + } + + Context "A scheduled task is enabled and has the correct settings" { + $testParams = @{ + TaskName = "Test task" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $true + } + + Mock Get-ScheduledTask { return @{ + Name = $testParams.TaskName + Path = $testParams.TaskPath + Actions = @(@{ + Execute = $testParams.ActionExecutable + Arguments = $testParams.Arguments + }) + Triggers = @(@{ + Repetition = @{ + Duration = $null + Interval = "PT$($testParams.RepeatInterval)M" + } + }) + Settings = @(@{ + Enabled = $true + }) + Principal = @{ + UserId = "SYSTEM" + } + } } + + It "should return present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "should return false from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "A scheduled task is disabled and has the correct settings" { + $testParams = @{ + TaskName = "Test task" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $false + } + + Mock Get-ScheduledTask { return @{ + Name = $testParams.TaskName + Path = $testParams.TaskPath + Actions = @(@{ + Execute = $testParams.ActionExecutable + Arguments = $testParams.Arguments + }) + Triggers = @(@{ + Repetition = @{ + Duration = $null + Interval = "PT$($testParams.RepeatInterval)M" + } + }) + Settings = @(@{ + Enabled = $false + }) + Principal = @{ + UserId = "SYSTEM" + } + } } + + It "should return present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "should return true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + + Context "A scheduled task is disabled but should be enabled" { + $testParams = @{ + TaskName = "Test task" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + Enable = $true + } + + Mock Get-ScheduledTask { return @{ + Name = $testParams.TaskName + Path = $testParams.TaskPath + Actions = @(@{ + Execute = $testParams.ActionExecutable + Arguments = $testParams.Arguments + }) + Triggers = @(@{ + Repetition = @{ + Duration = $null + Interval = "PT$($testParams.RepeatInterval)M" + } + }) + Settings = @(@{ + Enabled = $false + }) + Principal = @{ + UserId = "SYSTEM" + } + } } + + It "should return present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "should return false from the test method" { + Test-TargetResource @testParams | Should Be $false + } + + It "should update the scheduled task in the set method" { + Set-TargetResource @testParams + Assert-MockCalled Set-ScheduledTask + } + } + + Context "A Scheduled task exists, is disabled, and the optional parameter enable is not specified" -Fixture { + $testParams = @{ + TaskName = "Test task" + ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe" + ScheduleType = "Minutes" + RepeatInterval = 15 + } + + Mock Get-ScheduledTask { return @{ + Name = $testParams.TaskName + Path = $testParams.TaskPath + Actions = @(@{ + Execute = $testParams.ActionExecutable + Arguments = $testParams.Arguments + }) + Triggers = @(@{ + Repetition = @{ + Duration = $null + Interval = "PT$($testParams.RepeatInterval)M" + } + }) + Settings = @(@{ + Enabled = $false + }) + Principal = @{ + UserId = "SYSTEM" + } + } } + + It "should return present from the get method" { + (Get-TargetResource @testParams).Ensure | Should Be "Present" + } + + It "Should return true from the test method" { + Test-TargetResource @testParams | Should Be $true + } + } + } - } + } #endregion } finally diff --git a/appveyor.yml b/appveyor.yml index 399aff23..32a6e897 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ #---------------------------------# # environment configuration # #---------------------------------# -version: 1.6.{build}.0 +version: 1.7.{build}.0 image: WMF 5 install: - cinst -y pester @@ -40,7 +40,7 @@ deploy_script: # Creating project artifact $stagingDirectory = (Resolve-Path ..).Path $manifest = Join-Path $pwd "xComputerManagement.psd1" - (Get-Content $manifest -Raw).Replace("1.6.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest + (Get-Content $manifest -Raw).Replace("1.7.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest $zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip" Add-Type -assemblyname System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath) diff --git a/xComputerManagement.psd1 b/xComputerManagement.psd1 index 669ba844..ab8ad346 100644 --- a/xComputerManagement.psd1 +++ b/xComputerManagement.psd1 @@ -1,6 +1,6 @@ @{ # Version number of this module. -ModuleVersion = '1.6.0.0' +ModuleVersion = '1.7.0.0' # ID used to uniquely identify this module GUID = 'B5004952-489E-43EA-999C-F16A25355B89' @@ -49,7 +49,10 @@ PrivateData = @{ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = '* Added the following resources: + ReleaseNotes = '*Added support for enabling or disabling scheduled tasks +* The Name parameter resolves to $env:COMPUTERNAME when the value is localhost + +' * MSFT_xOfflineDomainJoin resource to join computers to an AD Domain using an Offline Domain Join request file. * MSFT_xScheduledTask resource to control scheduled tasks on the local server * MSFT_xOfflineDomainJoin: Corrected localizedData.DomainAlreadyJoinedhMessage name.