Skip to content

Commit b6a1ee0

Browse files
committed
Updating Schema and updating Tests
1 parent 4fe6ee2 commit b6a1ee0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

DSCResources/MSFT_xComputer/MSFT_xComputer.schema.mof

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ class MSFT_xComputer : OMI_BaseResource
88
[write,EmbeddedInstance("MSFT_Credential")] String Credential;
99
[write,EmbeddedInstance("MSFT_Credential")] String UnjoinCredential;
1010
[write] string WorkGroupName;
11+
[write] string Description;
1112
};

Tests/Unit/MSFT_xComputer.Tests.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ try
139139
It 'Should return a hashtable containing Name, DomainName, JoinOU, CurrentOU, Credential, UnjoinCredential, WorkGroupName and Description' {
140140
$Result = Get-TargetResource -Name $env:COMPUTERNAME
141141
$Result.GetType().Fullname | Should Be 'System.Collections.Hashtable'
142-
$Result.Keys | Sort-Object | Should Be @('Credential', 'CurrentOU', 'DomainName', 'JoinOU', 'Name', 'UnjoinCredential', 'WorkGroupName', 'Description')
142+
$Result.Keys | Sort-Object | Should Be @('Credential', 'CurrentOU', 'Description', 'DomainName', 'JoinOU', 'Name', 'UnjoinCredential', 'WorkGroupName')
143143
}
144144
It 'Throws if name is to long' {
145145
{Get-TargetResource -Name "ThisNameIsTooLong"} | Should Throw
@@ -284,7 +284,7 @@ try
284284
{Set-TargetResource -Name "ThisIsBad<>"} | Should Throw
285285
}
286286
It 'Changes computer description'{
287-
Mock Get-CimInstance {[PSCustomObject]@{Description = 'This is not my computer'}}
287+
#Mock Get-CimInstance {[PSCustomObject]@{Description = 'This is not my computer'}}
288288
Set-TargetResource -Name $env:COMPUTERNAME -Description = 'This is my computer'
289289
Assert-MockCalled -CommandName Set-CimInstance -Exactly 1 -Scope It
290290
}

0 commit comments

Comments
 (0)