mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
address some review feedback
This commit is contained in:
1 parent
f4ed351f86
commit
3ceca01b64
3 files changed
+29
-17
No files matched your search
@@ -3,19 +3,8 @@
|
||||
# determine whether we're elevated
|
||||
Describe "Set-Date" -Tag "CI" {
|
||||
BeforeAll {
|
||||
if ( $IsWindows ) {
|
||||
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$windowsPrincipal = new-object 'Security.Principal.WindowsPrincipal' $identity
|
||||
if ($windowsPrincipal.IsInRole("Administrators") -eq 1) { $IsElevated = $true } else { $IsElevated = $false }
|
||||
}
|
||||
else {
|
||||
if ( (whoami) -match "root" ) {
|
||||
$IsElevated = $true
|
||||
}
|
||||
else {
|
||||
$IsElevated = $false
|
||||
}
|
||||
}
|
||||
Import-Module (join-path $psscriptroot "../../Common/Test.Helpers.psm1")
|
||||
$IsElevated = Test-IsElevated
|
||||
}
|
||||
It "Set-Date should be able to set the date in an elevated context" -Skip:(! $IsElevated) {
|
||||
{ get-date | set-date } | Should not throw
|
||||
|
||||
Reference in new issue
Block a user