shanselman / shanselman/splitpanefix

(Harmless) Error in dry-run when PoSh profile missing

Open
#4 0 comments 1 reaction 2 assignees View on GitHub

@shanselman is already working on this.

Since May 17, 2026.

  • #8 by @copilot-swe-agent — closed without merging
Dominant language
PowerShell
Stars
42
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Hi

thanks for this tool (and all the rest...). I just noticed an error when running with -WhatIf argument. Maybe it is expected but notifying it anyway, just in case. When I ran the tool afterwards to actually apply changes, there was no error.

Steps to reproduce

  1. Have a Windows user without Powershell profile, i.e. with no %USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1 file
  2. Run .\Fix-SplitPanePersistence.ps1 -WhatIf in Powershell non-admin terminal

Expected behaviour

Tool shows preview of all changes, no error. One could expect it could show some warnings if actual changes would incur into problems. Or when system is somehow misconfigured.

Actual behaviour

Tools shows output with an error:

 .\Fix-SplitPanePersistence.ps1 -WhatIf
[DryRun] Starting Fix-SplitPanePersistence...
What if: Performing the operation "Create empty profile" on target "C:\Users\_myuser_\Documents\PowerShell\Microsoft.PowerShell_profile.ps1".
[DryRun] Oh My Posh not installed - adding OSC 9;9 prompt function
Get-Content: C:\Users\_myuser_\Downloads\Fix-SplitPanePersistence.ps1:625
Line |
 625 |      $profileContent = Get-Content $profilePath -Raw
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'C:\Users\_myuser_\Documents\PowerShell\Microsoft.PowerShell_profile.ps1' because it does not
     | exist.
What if: Performing the operation "Add OSC 9;9 prompt function" on target "C:\Users\_myuser_\Documents\PowerShell\Microsoft.PowerShell_profile.ps1".
What if: Performing the operation "Update Windows Terminal actions" on target "C:\Users\_myuser_\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json".
What if: Performing the operation "Change commandline to 'wsl.exe -d Ubuntu'" on target "WSL profile 'Ubuntu'".
[DryRun] Dry run complete - no changes were made

BTW: command output is very on point!

HTH

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.