2016-08-23 17:08:15 -07:00
|
|
|
# first check to see which platform we're on. If we're on windows we should be able
|
|
|
|
|
# to be sure whether we're running elevated. If we're on Linux, we can use whoami to
|
|
|
|
|
# determine whether we're elevated
|
2016-08-24 10:45:50 -07:00
|
|
|
Describe "Set-Date" -Tag "CI" {
|
2016-08-23 17:08:15 -07:00
|
|
|
BeforeAll {
|
2016-08-29 15:00:26 -07:00
|
|
|
Import-Module (join-path $psscriptroot "../../Common/Test.Helpers.psm1")
|
|
|
|
|
$IsElevated = Test-IsElevated
|
2016-08-23 17:08:15 -07:00
|
|
|
}
|
|
|
|
|
It "Set-Date should be able to set the date in an elevated context" -Skip:(! $IsElevated) {
|
|
|
|
|
{ get-date | set-date } | Should not throw
|
|
|
|
|
}
|
|
|
|
|
It "Set-Date should produce an error in a non-elevated context" -Skip:($IsElevated) {
|
|
|
|
|
{ get-date |set-date} | should throw
|
|
|
|
|
}
|
|
|
|
|
}
|