mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Address copilot comments second
This commit is contained in:
-20
@@ -3,26 +3,6 @@
|
||||
|
||||
Import-Module HelpersCommon
|
||||
|
||||
function Test-CanWriteToSystemConfigDir {
|
||||
$dir = Split-Path (Get-PowerShellConfiguration -Scope AllUsers).Path
|
||||
if (!(Test-Path $dir)) {
|
||||
try {
|
||||
$null = New-Item -ItemType Directory -Path $dir -Force -ErrorAction Stop
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
try {
|
||||
$testFile = Join-Path $dir ".pester-write-test"
|
||||
Set-Content -Path $testFile -Value '' -ErrorAction Stop
|
||||
Remove-Item $testFile -Force -ErrorAction SilentlyContinue
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Enable-ExperimentalFeature and Disable-ExperimentalFeature tests" -tags "Feature","RequireAdminOnWindows" {
|
||||
|
||||
BeforeAll {
|
||||
|
||||
@@ -3,26 +3,6 @@
|
||||
|
||||
Import-Module HelpersCommon
|
||||
|
||||
function Test-CanWriteToSystemConfigDir {
|
||||
$dir = Split-Path (Get-PowerShellConfiguration -Scope AllUsers).Path
|
||||
if (!(Test-Path $dir)) {
|
||||
try {
|
||||
$null = New-Item -ItemType Directory -Path $dir -Force -ErrorAction Stop
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
try {
|
||||
$testFile = Join-Path $dir ".pester-write-test"
|
||||
Set-Content -Path $testFile -Value '' -ErrorAction Stop
|
||||
Remove-Item $testFile -Force -ErrorAction SilentlyContinue
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
Describe "Get-ExperimentalFeature Tests" -tags "Feature","RequireAdminOnWindows" {
|
||||
|
||||
BeforeAll {
|
||||
|
||||
Reference in New Issue
Block a user