Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PR: Add Uninstall CTT PowerShell Profile feature (#3012) #3021

Conversation

Cryostrixx
Copy link
Contributor

@Cryostrixx Cryostrixx commented Nov 7, 2024

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactoring
  • Hotfix
  • Security patch
  • UI/UX improvement

Description

Makes some small fixes to my original PR that occurred as a result of conflict resolution.

Additional Changes

  • Removed the documentation files and links I added for PowerShell-Profile.
  • Removed the Create WinUtil Shortcut feature that was removed in an earlier PR.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

@Cryostrixx Cryostrixx changed the title Uninstall CTT PowerShell Profile (fix) Update: Uninstall CTT PowerShell Profile Nov 7, 2024
@Cryostrixx
Copy link
Contributor Author

Cryostrixx commented Nov 7, 2024

@og-mrk I think that's all of the changes, can you please review this and let me know if I need to make any other adjustments?

@Cryostrixx Cryostrixx changed the title Update: Uninstall CTT PowerShell Profile Update PR: Uninstall CTT PowerShell Profile Nov 7, 2024
Copy link
Contributor

@og-mrk og-mrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes looks good to me, thanks @Cryostrixx 😄

@Cryostrixx Cryostrixx marked this pull request as ready for review November 7, 2024 18:59
@Cryostrixx Cryostrixx changed the title Update PR: Uninstall CTT PowerShell Profile Update PR: Uninstall CTT PowerShell Profile (#3012) Nov 7, 2024
@Cryostrixx Cryostrixx changed the title Update PR: Uninstall CTT PowerShell Profile (#3012) Update PR: Uninstall CTT PowerShell Profile Nov 7, 2024
@Cryostrixx Cryostrixx changed the title Update PR: Uninstall CTT PowerShell Profile Update PR: Add Uninstall CTT PowerShell Profile feature (#3012) Nov 7, 2024
@Cryostrixx
Copy link
Contributor Author

These changes looks good to me, thanks @Cryostrixx 😄

Thanks for the feedback! If any other changes need to be made later, please feel free to @ me in the comments! :)

@MyDrift-user
Copy link
Contributor

MyDrift-user commented Nov 7, 2024

I am not sure if it is the fault of this PR, but when removing my powershell just stops working. terminal.exe, pwsh.exe and powershell.exe... even if running as admin.
An invisible window will appear if starting powershell / pwsh directly without terminal for a second before closing again

image

@Cryostrixx
Copy link
Contributor Author

Cryostrixx commented Nov 7, 2024

I am not sure if it is the fault of this PR, but when removing my powershell just stops working. terminal.exe, pwsh.exe and powershell.exe... even if running as admin. An invisible window will appear if starting powershell / pwsh directly without terminal for a second before closing again

image

Interesting... I have never seen this before, I'll do some testing on it and see if I can reproduce the issue.
While I do that, can you provide the following information for me?

  • Your Windows version
  • Your Windows Terminal version
  • Your PowerShell version
  • Your WinUtil version
  • And any errors you got.

@MyDrift-user
Copy link
Contributor

MyDrift-user commented Nov 7, 2024

image
image
I used the compiled version of this PR
Did not get any error, looked fine

@Cryostrixx
Copy link
Contributor Author

image image I used the compiled version of this PR Did not get any error, looked fine

Since it appears you can't run PowerShell, can you open Command Prompt as admin and run these two commands?

  • dism /online /cleanup-image /restorehealth
  • sfc /scannow

Once they are complete, please share the results.
While you are doing that I will match your software version so I can test it in an environment close to yours.

@MyDrift-user
Copy link
Contributor

MyDrift-user commented Nov 7, 2024

did a bit more testing and I think I know why. (this is the first and only time it did that to me)
it does not open at all, exept if you restart your devide, terminal gives me the error that the nerd font could not have been found.

@Cryostrixx
Copy link
Contributor Author

Cryostrixx commented Nov 7, 2024

did a bit more testing and I think I know why. (this is the first and only time it did that to me) it does not open at all, exept if you restart your devide, terminal gives me the error that the nerd font could not have been found.

The issue with Nerd Fonts is normal, I added a condition for it so that it will let the user know it was already uninstalled, I don't know why but sometimes it just doesn't get installed correctly, it will pop up a bunch of dialogs asking to replace a font file but it won't install anything.
Here's the output you should see if there was an issue installing the Nerd Fonts or if the Nerd Fonts were already uninstalled:

    CCCCCCCCCCCCCTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
 CCC::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T
CC:::::::::::::::CT:::::::::::::::::::::TT:::::::::::::::::::::T
C:::::CCCCCCCC::::CT:::::TT:::::::TT:::::TT:::::TT:::::::TT:::::T
C:::::C       CCCCCCTTTTTT  T:::::T  TTTTTTTTTTTT  T:::::T  TTTTTT
C:::::C                     T:::::T                T:::::T
C:::::C                     T:::::T                T:::::T
C:::::C                     T:::::T                T:::::T
C:::::C                     T:::::T                T:::::T
C:::::C                     T:::::T                T:::::T
C:::::C                     T:::::T                T:::::T
C:::::C       CCCCCC        T:::::T                T:::::T
C:::::CCCCCCCC::::C      TT:::::::TT            TT:::::::TT
CC:::::::::::::::C       T:::::::::T            T:::::::::T
CCC::::::::::::C         T:::::::::T            T:::::::::T
  CCCCCCCCCCCCC          TTTTTTTTTTT            TTTTTTTTTTT

====Chris Titus Tech=====
=====Windows Toolbox=====
===> Uninstalling: OhMyPosh... <===
===> Already Uninstalled: Nerd Fonts. <===
===> Uninstalling: Terminal-Icons... <===
===> Uninstalling: Zoxide... <===
Profile has been uninstalled. Please restart your shell to reflect the changes!

Still, you might want to check for system corruption with those commands I shared as a bad update can easily cause rendering issues with UWP apps like Windows Terminal.

@Cryostrixx
Copy link
Contributor Author

Cryostrixx commented Nov 8, 2024

Hello, @MyDrift-user! Just to let you know I did test it again with a version closer to yours (Windows 11 Home 24H2, PowerShell 7.4.6) and it does not appear to be reproducible, leading me to believe it is a Windows bug that causes the invisible PowerShell windows; likely due to corrupted system files or a bad Windows update:
Here are the screenshots of it running in all four environments (PS5 and PS7 with and without Windows Terminal):
WinUtil_PS5_NoWT
WinUtil_PS7_NoWT
WinUtil_PS5_WT
WinUtil_PS7_WT


Also, I removed Invoke-WinUtilpsProfile.ps1, I had renamed it to Invoke-WinUtilInstallPSProfile.ps1 to add the profile uninstallation feature, I must have accidentally re-added it when I was doing the conflict resolution.
If you can review those changes to make sure it all works I would really appreciate it. Thanks! :)

@Cryostrixx Cryostrixx closed this Nov 18, 2024
@Cryostrixx Cryostrixx deleted the uninstall-ctt-powershell-profile-fix branch November 30, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants