PowerShell novice general questions


  1. Posts : 46
    Win 10 Pro x64 21H2
       #1

    PowerShell novice general questions


    I wrote my first DOS bat file in 1988 and when PowerShell arrived I largely ignored it. Now circumstances have contrived to entice me into exploring its utility. Having now written a small script it is obvious PowerShell is much more than simply a turbocharged DOS CMD prompt but I have a couple of questions:

    1. Is there any reason to use the Core version instead of the Desktop version given I’m an individual user with a desktop primary computer and a very small (2 PCs, a printer and potentially a NAS component) network?
    2. Are both PowerShell and PowerShell ISE always components of a given PowerShell version (I’ve read a couple posts here regarding version 7.X but it is unclear if I should upgrade from the 5.1 and if I did is ISE automatically included)?
    3. Is there anything I can do via DOS CMD that I would not be able to with PowerShell?


    Thanx in advance for your time & expertise.
      My Computer


  2. Posts : 17,661
    Windows 10 Pro
       #2

    ritjesman said:
    Is there any reason to use the Core version instead of the Desktop version given I’m an individual user with a desktop primary computer and a very small (2 PCs, a printer and potentially a NAS component) network?
    Wikipedia about PS Core:

    On 18 August 2016, Microsoft announced that they had made PowerShell open-source and cross-platform with support for Windows, MacOS, CentOS and Ubuntu.[5] The source code was published on GitHub. The move to open source created a second incarnation of PowerShell called "PowerShell Core", which runs on .NET Core. It is distinct from "Windows PowerShell", which runs on the full .NET Framework.[19] Starting with version 5.1, PowerShell Core is bundled with Windows Server 2016 Nano Server.[
    Source: PowerShell - Wikipedia

    What it basically means is that if you do not need to run same scripts on other operating systems, you do not need it. However, it might be possible that at some time in the future, PS Core gets more features than native Windows PS. It might also be possible, that in the future Microsoft replaces native PS with PC Core in Windows.


    ritjesman said:
    Are both PowerShell and PowerShell ISE always components of a given PowerShell version (I’ve read a couple posts here regarding version 7.X but it is unclear if I should upgrade from the 5.1 and if I did is ISE automatically included)?
    PS version numbering is a bit confusing, native PS and PS Core using different versioning. If using native Windows PS, there's no need to worry. Windows Update and its feature upgrades will see that you are always running latest version of PS:


    ritjesman said:
    Is there anything I can do via DOS CMD that I would not be able to with PowerShell?
    The answer is a simple YES and NO

    There are some commands, that when containing parameters and switches can't be run as such in PowerShell.

    An example: command bcdedit without any parameters lists boot entries. It works both in Command Prompt and PS.

    If you add parameters to bcdedit, it works in Command Prompt, as it should. In screenshot, I am changing the description of a boot entry on my multi boot system:

    PowerShell novice general questions-image.png
    (click to enlarge.)

    The same command in PS produces an error (#1 in next screenshot). However, if I use prefix cmd /c to tell PS to run that command using Command Prompt, followed by the full bcdedit command with its parameters in quotes, it will also work in PS (#2 in screenshot):

    PowerShell novice general questions-image.png

    Kari
      My Computer


  3. Posts : 46
    Win 10 Pro x64 21H2
    Thread Starter
       #3

    Thank you - right on the mark.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:49.
Find Us




Windows 10 Forums