File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 151151 Context " $ ( $Global :DSCResourceName ) \Set-TargetResource" {
152152 Mock Rename-Computer {}
153153 Mock Add-Computer {}
154+ Mock Set-CimInstance {}
154155 It ' Throws if both DomainName and WorkGroupName are specified' {
155156 {Set-TargetResource - Name $Env: ComputerName - DomainName ' contoso.com' - WorkGroupName ' workgroup' } | Should Throw
156157 Assert-MockCalled - CommandName Rename-Computer - Exactly 0 - Scope It
285286 }
286287 It ' Changes computer description in a workgroup' {
287288 Mock Get-ComputerDomain {' ' }
288- Mock Get-WMIObject {[PSCustomObject ]@ {Domain = ' Contoso ' ; Workgroup = ' Contoso' ;PartOfDomain = $false }}
289+ Mock Get-WMIObject {[PSCustomObject ]@ {Workgroup = ' Contoso' ;PartOfDomain = $false }}
289290 Set-TargetResource - Name $env: COMPUTERNAME - WorkGroupName ' Contoso' - Description = ' This is my computer' | Should BeNullOrEmpty
290291 Assert-MockCalled - CommandName Set-CimInstance - Exactly 1 - Scope It
291292 }
You can’t perform that action at this time.
0 commit comments