PowerShell 7.5.2

Discussion in 'other software & services' started by TerryWood, Aug 20, 2025.

  1. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,109
    Hi @ Wilders

    I am on Win 11 24 H2 latest version and have just installed Powershell 7.5.2 (In C:\Program Files\PowerShell).

    I want to create two shortcuts on my desktop (Not Scripts) to run SFC /Scannow and DISM /Online /Cleanup-Image /RestoreHealth.

    I have played about and come up with the following:-

    1) SFC /SCANNOW

    TARGET = "C:\Program Files\PowerShell\7\pwsh.exe" -NoExit -command "sfc /scannow"
    START IN = Empty

    2) DISM RESTORE HEALTH

    TARGET = "C:\Program Files\PowerShell\7\pwsh.exe" -NoExit -command "DISM /Online /Cleanup-Image /RestoreHealth"
    START IN = EMPTY

    Both shortcuts are Admin AND THEY BOTH WORK or appear to.

    MY QUESTIONS ARE:-

    1) In the START IN field (in both shortcuts) do I need to put anything in it?

    2) If so what should it be?

    3) What does START IN mean?

    Thank you

    Terry
     
  2. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,634
    Location:
    U.S.A. (South)
    Bringing this back up the ladder in anticipation of some quality useful suggestions to the questions.

    I remember when PowerShell v7 came out i was disappointed to find it didn't replace the stock PS as i had hoped although it launches separately, it wasn't exactly what i wanted.
     
  3. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,891
    Location:
    USA

    The "Start in" field allows you to specify a different starting target directory. It is useful if you want to launch a program from one location but need to immediately give it access to data from a different location.

    For example, create a shortcut on the desktop for PowerShell (pwsh.exe), and put "C:\Program Files\PowerShell\7\pwsh.exe" in the "Target" field. Leave the "Start in" field blank. When you double click on the shortcut, it will launch PowerShell with the starting directory "C:\Program Files\PowerShell\7\"

    Now if you put "C:\Users\" in the "Start in" field and again launch PowerShell from the shortcut, it will launch while already in the "C:\Users\" directory.

    So using the "Start in" field, you do not have to navigate to a particular directory in PowerShell, PowerShell will automatically launch in the said directory. It is useful if the path to a particular directory is very long and you need to run PowerShell commands to it often.

    In your case it does not matter, you can leave the "Start in" directory blank, as you are already using an exact command with PowerShell.
     
    Last edited: Aug 21, 2025
  4. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,891
    Location:
    USA

    You can make PowerShell 7 the default in Terminal's settings, so every time you launch terminal, it will launch with PowerShell 7. And you can uninstall Windows PowerShell from "Turn Windows features on or off", however this is not recommended because there may be some scripts used by some software that still use the older Windows PowerShell, and uninstalling it will cause them to break. So leave the older one installed, but use the PS 7 by default instead.

    Edit:

    Just some clarification. I was in a rush this morning so just wrote the above from memory.

    You can only uninstall PowerShell 2.0 from "Turn Windows features on or off". And you do not actually need to do this now as Microsoft is already in the process of removing PS 2.0 starting August 2025.

    You cannot uninstall Windows PS 5.1 that is built-in to Windows 10 and 11, and doing this is not recommended in any case as it will break a lot of apps and programs that depend on it.

    So the best option is to install PS 7.5.2 and make it your default PowerShell in Windows Terminal. So every time you launch Terminal, you will be interacting with PS 7.5.2 instead of the built-in PS 5.1
     
    Last edited: Aug 21, 2025
  5. TerryWood

    TerryWood Registered Member

    Joined:
    Jan 14, 2006
    Posts:
    1,109
    Hi Raza0007

    Thank you so much for your extremely clear explanation. I never knew that, so I have learnt something. It's really appreciated

    Thanks also to Easter for pushing my questions "up the ladder".

    Terry
     
  6. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,634
    Location:
    U.S.A. (South)
    @Raza0007 - Thanks for the info. As i expected standard Windows PS is solid hard wired to the O/S, however your instructions help greatly to at least offer more direct usage of the NEW PS albeit not a complete default and that's by design obviously.
     
  7. Raza0007

    Raza0007 Registered Member

    Joined:
    Mar 30, 2009
    Posts:
    1,891
    Location:
    USA
    @EASTER, Powershell is an integral part of the OS and a lot of apps and even the OS itself depends on Powershell cmdlets to function properly. And most devs will target the PowerShell that is embedded in Windows over the one that a user has to download separately.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.