From aa636926fa3deee4163a23f9a196bb8315c0c6b7 Mon Sep 17 00:00:00 2001 From: Chris Titus Date: Thu, 7 May 2026 15:53:01 -0500 Subject: [PATCH] chore: Update generated dev docs (#4457) --- .../InstallPSProfile.md | 15 +++++++++++---- .../UninstallPSProfile.md | 11 +++++------ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/InstallPSProfile.md b/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/InstallPSProfile.md index b5ff4168..d7c0d894 100644 --- a/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/InstallPSProfile.md +++ b/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/InstallPSProfile.md @@ -5,11 +5,18 @@ description: "" ```powershell {filename="functions/private/Invoke-WinUtilInstallPSProfile.ps1",linenos=inline,linenostart=1} function Invoke-WinUtilInstallPSProfile { - - if (Test-Path $Profile) { - Rename-Item $Profile -NewName ($Profile + '.bak') + if (-not (Get-Command wt)) { + Write-Host "Windows Terminal not found installing..." + Install-WinUtilWinget + winget install Microsoft.WindowsTerminal --source winget --silent } - Start-Process pwsh -ArgumentList '-Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex"' + if (-not (Get-Command pwsh)) { + Write-Host "Powershell 7 not found installing..." + Install-WinUtilWinget + winget install Microsoft.PowerShell --source winget --silent + } + + wt new-tab pwsh -NoExit -Command "irm https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1 | iex" } ``` diff --git a/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/UninstallPSProfile.md b/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/UninstallPSProfile.md index 1fada38a..276d7165 100644 --- a/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/UninstallPSProfile.md +++ b/docs/content/dev/features/Powershell-Profile-Powershell-7--Only/UninstallPSProfile.md @@ -5,12 +5,11 @@ description: "" ```powershell {filename="functions/private/Invoke-WinUtilUninstallPSProfile.ps1",linenos=inline,linenostart=1} function Invoke-WinUtilUninstallPSProfile { - if (Test-Path ($Profile + '.bak')) { - Remove-Item $Profile - Rename-Item ($Profile + '.bak') -NewName $Profile - } - else { - Remove-Item $Profile + + if (Test-Path ($Profile + ".bak")) { + Move-Item -Path ($Profile + ".bak") -Destination $Profile + } else { + Remove-Item -Path $Profile } Write-Host "Successfully uninstalled CTT PowerShell Profile." -ForegroundColor Green