Skip to content

Commit

Permalink
Fix bug in file handing when input is a script file
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGough committed Dec 16, 2024
1 parent 4922f91 commit 40ec1d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PSAppDeployToolkit.Tools/Public/Convert-ADTDeployment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ function Convert-ADTDeployment
# Create a temp copy of the script to run ScriptAnalyzer fixes on - prefix filename with _ if it's named Invoke-AppDeployToolkit.ps1
$inputScriptPath = if ($Path -match '(?<=^|\\)Invoke-AppDeployToolkit.ps1$')
{
[System.IO.Path]::Combine(([System.IO.Path]::GetDirectoryName($Path)), "_$([System.IO.Path]::GetFileName($Path))")
[System.IO.Path]::Combine($tempFolderPath, "_$([System.IO.Path]::GetFileName($Path))")
}
else
{
$Path
[System.IO.Path]::Combine($tempFolderPath, [System.IO.Path]::GetFileName($Path))
}

Write-Verbose -Message "Creating copy of [$Path] as [$inputScriptPath]"
Expand Down

0 comments on commit 40ec1d0

Please sign in to comment.