8000
  • Fix test for `-WorkingDirectory` when `$PROFILE` doesn't exist by SteveL-MSFT · Pull Request #8152 · PowerShell/PowerShell · GitHub
    [go: up one dir, main page]

    Skip to content

    Fix test for -WorkingDirectory when $PROFILE doesn't exist#8152

    Merged
    adityapatwardhan merged 1 commit intoPowerShell:masterfrom
    SteveL-MSFT:workingdirectory-test
    Oct 31, 2018
    Merged

    Fix test for -WorkingDirectory when $PROFILE doesn't exist#8152
    adityapatwardhan merged 1 commit intoPowerShell:masterfrom
    SteveL-MSFT:workingdirectory-test

    Conversation

    @SteveL-MSFT
    Copy link
    Member
    @SteveL-MSFT SteveL-MSFT commented Oct 31, 2018

    PR Summary

    Test expected $PROFILE to exist, but doesn't exist on CI systems. Part of the path to $PROFILE doesn't exist so we forcibly create $PROFILE with full path. Add checks if it exists and if not, make sure to remove test $PROFILE.

    PR Checklist

    fix test when $PROFILE doesn't exist
    @SteveL-MSFT SteveL-MSFT force-pushed the workingdirectory-test branch from 4731476 to fc0a38e Compare October 31, 2018 01:53
    $currentProfile = Get-Content $PROFILE
    }
    else {
    New-Item -ItemType File -Path $PROFILE -Force
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    New-Item -ItemType File -Path $PROFILE -Force
    $null = New-Item -ItemType File -Path $PROFILE -Force

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Merging as this comment is non-blocking.

    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    New-Item -ItemType File -Path $PROFILE -Force
    New-Item -ItemType File -Path $PROFILE -Force > $null

    😉

    @adityapatwardhan adityapatwardhan merged commit 1eec123 into PowerShell:master Oct 31, 2018
    @SteveL-MSFT SteveL-MSFT deleted the workingdirectory-test branch March 10, 2020 21:01
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    3 participants

    0