Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMC Tools: Avoid more PowerShell path cmdlets #22169

Merged
1 commit merged into from
Aug 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/EFCore.Tools/tools/EntityFrameworkCore.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ function Script-DbContext
if (![IO.Path]::IsPathRooted($intermediatePath))
{
$projectDir = GetProperty $dteProject.Properties 'FullPath'
$intermediatePath = Join-Path $projectDir $intermediatePath -Resolve | Convert-Path
$intermediatePath = [IO.Path]::GetFullPath((Join-Path $projectDir $intermediatePath))
}

$scriptFileName = [IO.Path]::ChangeExtension([IO.Path]::GetRandomFileName(), '.sql')
Expand Down Expand Up @@ -679,7 +679,7 @@ function Script-Migration
if (![IO.Path]::IsPathRooted($intermediatePath))
{
$projectDir = GetProperty $dteProject.Properties 'FullPath'
$intermediatePath = Join-Path $projectDir $intermediatePath -Resolve | Convert-Path
$intermediatePath = [IO.Path]::GetFullPath((Join-Path $projectDir $intermediatePath))
}

$scriptFileName = [IO.Path]::ChangeExtension([IO.Path]::GetRandomFileName(), '.sql')
Expand Down Expand Up @@ -882,7 +882,7 @@ function GetStartupProject($name, $fallbackProject)
if (![IO.Path]::IsPathRooted($startupProjectPath))
{
$solutionPath = Split-Path (GetProperty $DTE.Solution.Properties 'Path')
$startupProjectPath = Join-Path $solutionPath $startupProjectPath -Resolve | Convert-Path
$startupProjectPath = [IO.Path]::GetFullPath((Join-Path $solutionPath $startupProjectPath))
}

$startupProject = GetSolutionProjects | ?{
Expand Down Expand Up @@ -1068,7 +1068,7 @@ function EF($project, $startupProject, $params, $applicationArgs, [switch] $skip
}
}

if (Test-Path $runtimeConfig)
if ([IO.File]::Exists($runtimeConfig))
{
$dotnetParams += '--runtimeconfig', $runtimeConfig
}
Expand Down Expand Up @@ -1122,7 +1122,7 @@ function EF($project, $startupProject, $params, $applicationArgs, [switch] $skip
}

$arguments = ToArguments $params
if ($applicationArgs -ne $null)
if ($applicationArgs)
{
$arguments += ' -- '
$arguments += $applicationArgs
Expand Down