Skip to content

Commit

Permalink
Fix MacOs test
Browse files Browse the repository at this point in the history
  • Loading branch information
iSazonov committed Jun 1, 2020
1 parent 6c461d5 commit 293d359
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,23 @@ Describe "New-Item with links" -Tags @('CI', 'RequireAdminOnWindows') {

Describe "New-Item with links fails for non elevated user if developer mode not enabled on Windows." -Tags "CI" {
BeforeAll {
# on macOS, the /tmp directory is a symlink, so we'll resolve it here
$TestPath = $TestDrive
if ($IsMacOS)
{
$item = Get-Item $TestPath
$dirName = $item.BaseName
$item = Get-Item $item.PSParentPath -Force
if ($item.LinkType -eq "SymbolicLink")
{
$TestPath = Join-Path $item.Target $dirName
}
}

$testfile = "testfile.txt"
$testlink = "testlink"
$FullyQualifiedFile = Join-Path -Path $TestDrive -ChildPath $testfile
$TestFilePath = Join-Path -Path $TestDrive -ChildPath $testlink
$FullyQualifiedFile = Join-Path -Path $TestPath -ChildPath $testfile
$TestFilePath = Join-Path -Path $TestPath -ChildPath $testlink
$developerModeEnabled = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock -ErrorAction SilentlyContinue).AllowDevelopmentWithoutDevLicense -eq 1
$minBuildRequired = [System.Environment]::OSVersion.Version -ge "10.0.14972"
$developerMode = $developerModeEnabled -and $minBuildRequired
Expand Down

0 comments on commit 293d359

Please sign in to comment.