shanselman / shanselman/splitpanefix
(Harmless) Error in dry-run when PoSh profile missing
@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
- Have a Windows user without Powershell profile, i.e. with no
%USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1file - Run
.\Fix-SplitPanePersistence.ps1 -WhatIfin 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.