Skip to content

Commit e67f58e

Browse files
authored
Merge pull request #139 from PowerShell/dev
Release of version 4.0.0.0 of xComputerManagement
2 parents 2715745 + a2ac17c commit e67f58e

61 files changed

Lines changed: 2268 additions & 1664 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/RunAllTests.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[string] $repoRoot = Split-Path -Path (Split-Path -Path $Script:MyInvocation.MyCommand.Path)
2+
if ( (-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests'))) -or `
3+
(-not (Test-Path -Path (Join-Path -Path $repoRoot -ChildPath 'DSCResource.Tests\TestHelper.psm1'))) )
4+
{
5+
& git @('clone','https://github.com/PowerShell/DscResource.Tests.git',(Join-Path -Path $repoRoot -ChildPath '\DSCResource.Tests\'))
6+
}
7+
8+
Import-Module (Join-Path $PSScriptRoot "..\Tests\TestHarness.psm1" -Resolve)
9+
$dscTestsPath = Join-Path -Path $PSScriptRoot `
10+
-ChildPath "..\Modules\xComputerManagement\DscResource.Tests\Meta.Tests.ps1"
11+
Invoke-TestHarness -DscTestsPath $dscTestsPath

.vscode/launch.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "PowerShell",
6+
"type": "PowerShell",
7+
"request": "launch",
8+
"program": "${file}",
9+
"args": [],
10+
"cwd": "${file}"
11+
},
12+
{
13+
"name": "Run all tests",
14+
"type": "PowerShell",
15+
"request": "launch",
16+
"program": "${workspaceRoot}/.vscode/RunAllTests.ps1"
17+
}
18+
]
19+
}

CHANGELOG.md

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# Versions
2+
3+
## Unreleased
4+
5+
## 4.0.0.0
6+
7+
- BREAKING CHANGE: xScheduledTask:
8+
- Breaking change because `Get-TargetResource` no longer outputs
9+
`ActionExecutable` and `ScheduleType` properties when the scheduled
10+
task does not exist. It will also include `TaskPath` in output when
11+
scheduled task does not exist.
12+
- xScheduledTask:
13+
- Add support to disable built-in scheduled tasks - See [Issue #74](https://github.com/PowerShell/xComputerManagement/issues/74).
14+
- Fix unit test mocked schedule task object structure.
15+
- Fix error message when trigger type is unknown - See [Issue #121](https://github.com/PowerShell/xComputerManagement/issues/121).
16+
- Moved strings into separate strings file.
17+
- Updated to meet HQRM guidelines.
18+
- xComputer:
19+
- Resolved bug in Get-ComputerDomain where LocalSystem doesn't have
20+
rights to the domain.
21+
- Updated tests to meet Pester V4 guidelines - See [Issue #106](https://github.com/PowerShell/xComputerManagement/issues/106).
22+
- Converted module to use auto documentation format.
23+
24+
## 3.2.0.0
25+
26+
- xScheduledTask:
27+
- Enable Execution Time Limit of task to be set to indefinite
28+
by setting `ExecutionTimeLimit` to '00:00:00' - See [Issue #115](https://github.com/PowerShell/xComputerManagement/issues/115).
29+
- xPowerPlan:
30+
- Updated to meet HQRM guidelines.
31+
- Converted calls to `throw` to use `New-InvalidOperationException`
32+
in CommonResourceHelper.
33+
- Move Common Resource Helper functions into modules folder.
34+
- Changed resources to use Common Resource Helper functions.
35+
- Moved strings for Common Resource Helper functions into separate
36+
strings file.
37+
- Added unit tests for Common Helper functions.
38+
39+
## 3.1.0.0
40+
41+
- xOfflineDomainJoin:
42+
- Updated to meet HQRM guidelines.
43+
- xScheduledTask:
44+
- Applied autoformatting to examples to improve readability.
45+
- Added LogonType and RunLevel parameters for controlling
46+
task execution.
47+
- Correct `Assert-VerifiableMocks` to `Assert-VerifiableMock`
48+
49+
## 3.0.0.0
50+
51+
- xComputer: Added parameter to set the local computer description along with documentation
52+
and unit tests for this change.
53+
- BREAKING CHANGE: xScheduledTask:
54+
- Converted all Interval/Duration type parameters over to be string format
55+
to prevent the Timezone the MOF file was created in from being stored.
56+
This is to fix problems where MOF files are created in one timezone but
57+
deployed nodes to a different timezone - See [Issue #85](https://github.com/PowerShell/xComputerManagement/issues/85)
58+
- Added ConvertTo-TimeSpanFromScheduledTaskString function and refactored
59+
to reduce code duplication.
60+
- Added support for setting repetition duration to `Indefinitely`.
61+
- xComputer:
62+
- Moved strings to localization file.
63+
- Updated to meet HQRM guidelines.
64+
- xVirtualMemory:
65+
- Refactored shared common code into new utility functions to
66+
reduce code duplication and improve testability.
67+
- Moved strings into localizable strings file.
68+
- Converted calls to `throw` to use `New-InvalidOperationException`
69+
in CommonResourceHelper.
70+
- Improved unit test coverage.
71+
- Updated to meet HQRM guidelines.
72+
73+
## 2.1.0.0
74+
75+
- xComputer: Changed comparison that validates if we are in the correct AD
76+
Domain to work correctly if FQDN wasn't used.
77+
- Updated AppVeyor.yml to use AppVeyor.psm1 module in DSCResource.Tests.
78+
- Removed Markdown.md errors.
79+
- Added CodeCov.io support.
80+
- xScheduledTask
81+
- Fixed incorrect TaskPath handling - [Issue #45](https://github.com/PowerShell/xComputerManagement/issues/45)
82+
- Change examples to meet HQRM standards and optin to Example validation
83+
tests.
84+
- Replaced examples in README.MD to links to Example files.
85+
- Added the VS Code PowerShell extension formatting settings that cause PowerShell
86+
files to be formatted as per the DSC Resource kit style guidelines - [Issue #91](https://github.com/PowerShell/xComputerManagement/issues/91).
87+
- Opted into Common Tests 'Validate Module Files' and 'Validate Script Files'.
88+
- Converted files with UTF8 with BOM over to UTF8 - fixes [Issue #90](https://github.com/PowerShell/xComputerManagement/issues/90).
89+
- Updated Year to 2017 in License and Manifest - fixes [Issue #87](https://github.com/PowerShell/xComputerManagement/issues/87).
90+
- Added .github support files - fixes [Issue #88](https://github.com/PowerShell/xComputerManagement/issues/88):
91+
- CONTRIBUTING.md
92+
- ISSUE_TEMPLATE.md
93+
- PULL_REQUEST_TEMPLATE.md
94+
- Resolved all PSScriptAnalyzer warnings and style guide warnings.
95+
- xOfflineDomainJoin:
96+
- Changed to use CommonResourceHelper to load localization strings.
97+
- Renamed en-US to be correct case so that localization strings can be loaded.
98+
- Suppress PSScriptAnalyzer rule PSAvoidGlobalVars for
99+
`$global:DSCMachineStatus = 1`.
100+
- xComputer:
101+
- Suppress PSScriptAnalyzer rule PSAvoidGlobalVars for
102+
`$global:DSCMachineStatus = 1`.
103+
- xVirtualMemory:
104+
- Suppress PSScriptAnalyzer rule PSAvoidGlobalVars for
105+
`$global:DSCMachineStatus = 1`.
106+
107+
## 2.0.0.0
108+
109+
- Updated resources
110+
- BREAKING CHANGE: xScheduledTask: Added nearly all available parameters for tasks
111+
- xVirtualMemory:
112+
- Fixed failing tests.
113+
114+
## 1.10.0.0
115+
116+
- Added resources:
117+
- xVirtualMemory
118+
119+
## 1.9.0.0
120+
121+
- Added resources
122+
- xPowerPlan
123+
124+
## 1.8.0.0
125+
126+
- Converted AppVeyor.yml to pull Pester from PSGallery instead of
127+
Chocolatey.
128+
- Changed AppVeyor.yml to use default image
129+
- xScheduledTask: Fixed bug with different OS versions returning repeat interval
130+
differently
131+
132+
## 1.7.0.0
133+
134+
- Added support for enabling or disabling scheduled tasks
135+
- The Name parameter resolves to $env:COMPUTERNAME when the value is localhost
136+
137+
## 1.6.0.0
138+
139+
- Added the following resources:
140+
- MSFT_xOfflineDomainJoin resource to join computers to an AD Domain using an
141+
Offline Domain Join request file.
142+
- MSFT_xScheduledTask resource to control scheduled tasks on the local server
143+
- MSFT_xOfflineDomainJoin: Corrected localizedData.DomainAlreadyJoinedhMessage name.
144+
- xComputer: Changed credential generation code in tests to avoid triggering
145+
PSSA rule PSAvoidUsingConvertToSecureStringWithPlainText.
146+
Renamed unit test file to match the name of Resource file.
147+
148+
## 1.5.0.0
149+
150+
- Update Unit tests to use the standard folder structure and test templates.
151+
- Added .gitignore to prevent commit of DSCResource.Tests.
152+
153+
## 1.4.0.0
154+
155+
- Added validation to the Name parameter
156+
- Added the JoinOU parameter which allows you to specify the organizational unit
157+
that the computer account will be created in
158+
- Added the CurrentOU read-only property that shows the organizational unit that
159+
the computer account is currently in
160+
161+
## 1.3.0
162+
163+
- xComputer
164+
- Fixed issue with Test-TargetResource when not specifying Domain or
165+
Workgroup name
166+
- Added tests
167+
168+
## 1.2.2
169+
170+
- Added types to Get/Set/Test definitions to allow xResourceDesigner validation
171+
to succeed
172+
173+
## 1.2
174+
175+
- Added functionality to enable moving computer from one domain to another
176+
- Modified Test-DscConfiguration logics when testing domain join
177+
178+
## 1.0.0.0
179+
180+
- Initial release with the following resources:
181+
- xComputer

DSCResources/MSFT_xComputer/MSFT_xComputer.psm1 renamed to Modules/xComputerManagement/DSCResources/MSFT_xComputer/MSFT_xComputer.psm1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,13 +572,21 @@ function Get-ComputerDomain
572572

573573
try
574574
{
575-
if ($NetBios)
575+
$domainInfo = Get-CimInstance -ClassName Win32_ComputerSystem
576+
if ($domainInfo.PartOfDomain -eq $true)
576577
{
577-
$domainName = $ENV:USERDOMAIN
578+
if ($NetBios)
579+
{
580+
$domainName = (Get-Item -Path Env:\USERDOMAIN).Value
581+
}
582+
else
583+
{
584+
$domainName = $domainInfo.Domain
585+
}
578586
}
579587
else
580588
{
581-
$domainName = ([System.DirectoryServices.ActiveDirectory.Domain]::GetComputerDomain()).Name
589+
$domainName = ''
582590
}
583591

584592
return $domainName

DSCResources/MSFT_xComputer/MSFT_xComputer.schema.mof renamed to Modules/xComputerManagement/DSCResources/MSFT_xComputer/MSFT_xComputer.schema.mof

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
[ClassVersion("1.0.1.0"), FriendlyName("xComputer")]
2-
class MSFT_xComputer : OMI_BaseResource
3-
{
4-
[Key, Description("The desired computer name.")] String Name;
5-
[Write, Description("The name of the domain to join.")] String DomainName;
6-
[Write, Description("The distinguished name of the organizational unit that the computer account will be created in.")] String JoinOU;
7-
[Write, Description("Credential to be used to join a domain."), EmbeddedInstance("MSFT_Credential")] String Credential;
8-
[Write, Description("Credential to be used to leave a domain."), EmbeddedInstance("MSFT_Credential")] String UnjoinCredential;
9-
[Write, Description("The name of the workgroup.")] String WorkGroupName;
10-
[Write, Description("The value assigned here will be set as the local computer description.")] String Description;
11-
[Read, Description("A read-only property that specifies the organizational unit that the computer account is currently in.")] String CurrentOU;
12-
};
1+
[ClassVersion("1.0.1.0"), FriendlyName("xComputer")]
2+
class MSFT_xComputer : OMI_BaseResource
3+
{
4+
[Key, Description("The desired computer name.")] String Name;
5+
[Write, Description("The name of the domain to join.")] String DomainName;
6+
[Write, Description("The distinguished name of the organizational unit that the computer account will be created in.")] String JoinOU;
7+
[Write, Description("Credential to be used to join a domain."), EmbeddedInstance("MSFT_Credential")] String Credential;
8+
[Write, Description("Credential to be used to leave a domain."), EmbeddedInstance("MSFT_Credential")] String UnjoinCredential;
9+
[Write, Description("The name of the workgroup.")] String WorkGroupName;
10+
[Write, Description("The value assigned here will be set as the local computer description.")] String Description;
11+
[Read, Description("A read-only property that specifies the organizational unit that the computer account is currently in.")] String CurrentOU;
12+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Description
2+
3+
The resource allows you to configure a computer by changing its name and
4+
description and modifying its Active Directory domain or workgroup membership.

DSCResources/MSFT_xComputer/en-US/MSFT_xComputer.strings.psd1 renamed to Modules/xComputerManagement/DSCResources/MSFT_xComputer/en-US/MSFT_xComputer.strings.psd1

File renamed without changes.

DSCResources/MSFT_xOfflineDomainJoin/MSFT_xOfflineDomainJoin.psm1 renamed to Modules/xComputerManagement/DSCResources/MSFT_xOfflineDomainJoin/MSFT_xOfflineDomainJoin.psm1

File renamed without changes.

DSCResources/MSFT_xOfflineDomainJoin/MSFT_xOfflineDomainJoin.schema.mof renamed to Modules/xComputerManagement/DSCResources/MSFT_xOfflineDomainJoin/MSFT_xOfflineDomainJoin.schema.mof

File renamed without changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Description
2+
3+
The resource allows you to join computers to an Active Directory domain using an
4+
[Offline Domain Join](https://technet.microsoft.com/en-us/library/offline-domain-join-djoin-step-by-step(v=ws.10).aspx)
5+
request file.

0 commit comments

Comments
 (0)