Skip to content

Commit 5cb2379

Browse files
committed
fix: Update how we determine the script path to delete
1 parent 9b85185 commit 5cb2379

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

_InitializeRepository.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ Begin
7676

7777
function DeleteThisScript
7878
{
79-
[string] $scriptPath = $MyInvocation.MyCommand.Path
80-
[string] $deleteCommand = "-ExecutionPolicy Bypass -NoProfile -Command `"Start-Sleep -Seconds 1; Remove-Item -Path $scriptPath -Force`""
79+
[string] $scriptPath = Join-Path -Path $PSScriptRoot -ChildPath '_InitializeRepository.ps1'
80+
Write-Output "Script path to delete is: $scriptPath"
81+
[string] $deleteCommand = "-ExecutionPolicy Bypass -NoProfile -Command `"Start-Sleep -Seconds 1; Remove-Item -Path '$scriptPath' -Force`""
8182

8283
$powerShellVersion = $PSVersionTable.PSVersion.Major
8384
if ($powerShellVersion -le 5)

0 commit comments

Comments
 (0)