forked from dsccommunity/xPSDesiredStateConfiguration
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78f7b98
commit 546099d
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<# | ||
.summary | ||
Test suite for MSFT_xPackageResource.psm1 | ||
#> | ||
[CmdletBinding()] | ||
param() | ||
|
||
Import-Module $PSScriptRoot\..\DSCResources\MSFT_xPackageResource\MSFT_xPackageResource.psm1 | ||
|
||
$ErrorActionPreference = 'stop' | ||
Set-StrictMode -Version latest | ||
|
||
|
||
function Suite.BeforeAll { | ||
# Remove any leftovers from previous test runs | ||
Suite.AfterAll | ||
|
||
} | ||
|
||
function Suite.AfterAll { | ||
Remove-Module MSFT_xPackageResource | ||
} | ||
|
||
function Suite.BeforeEach { | ||
} | ||
|
||
try | ||
{ | ||
InModuleScope MSFT_xPackageResource { | ||
Describe 'Get-RegistryValueIgnoreError' { | ||
|
||
It 'Should get values from HKLM' { | ||
$installValue = Get-RegistryValueIgnoreError 'LocalMachine' "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProgramFilesDir" Registry64 | ||
$installValue | should be $env:programfiles | ||
} | ||
It 'Should get values from HKCU' { | ||
$installValue = Get-RegistryValueIgnoreError 'CurrentUser' "Environment" "Temp" Registry64 | ||
$installValue | should be $env:temp | ||
} | ||
|
||
} | ||
} | ||
} | ||
finally | ||
{ | ||
Suite.AfterAll | ||
} | ||
|