• Why PowerShell?

    Home » Forums » Newsletter and Homepage topics » Why PowerShell?

    Author
    Topic
    #2573998

    ISSUE 20.29 • 2023-07-17 WINDOWS By Bruce Kriebel For nearly 50 years, we’ve all been using the commands that originated from MS-DOS command line inte
    [See the full post at: Why PowerShell?]

    7 users thanked author for this post.
    Viewing 12 reply threads
    Author
    Replies
    • #2573999

      cmd.exe will still rules 🙂

      2 users thanked author for this post.
      • #2575158

        powersHELL is no match for the CLI or cmd.exe, whether windows or linux.

    • #2574000

      One of my favorite and most useful “fixes” to Windows 10 is the restoration of the “Open command window here” menu item to Explorer’s context menus.

      They can’t force me to use PowerShell if I can avoid it.

    • #2574003

      For a very long time I was able to get through my computing life without doing any code except for batch files. I remember finding the syntax for PowerShell to be quite difficult. It was only when I learned some Java for a personal project that I realised that PowerShell is effectively a language of its own and I was able to understand it better with that knowledge.

      But I’m also at the stage of: if I need to learn another scripting language should it be bash instead?

    • #2574010

      Never liked PowerShell. Avoid it and still use cmd.exe. Works better for me. Less clutter in my head.

    • #2574054

      I’ve been using some PowerShell, but still mostly Cmd.  However, I’ve been considering some of my customizations of Windows could be more easily crafted into PowerShell scripts.  I just haven’t gotten around to that yet.

      Running PowerShell as Trusted Installer (via Process Hacker) could be quite powerful.   I need to look into that further.

      Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
      We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
      We were all once "Average Users".

    • #2574053

      Hi Bruce! Let me add some positivity around PowerShell being the prior comments were all somewhat a bit negative. I’ve been developing software for a long time. I’ve seen a lot of tools come and go, and like you, my first computer was a RaidoShack TRS-80. In fact, I’m still working in IT after all those years. I’ve used so many tools throughout my career, but once I started using PowerShell I loved it. It’s the people who use DOS, that don’t want to switch to it, and the people who use high-level languages like Python, C#, etc., that say it is not a full blow programming language and you should not use for serious development. I can tell you; I have written so many programs using PowerShell, I have lost count. In fact, I wrote a “boat load” of them at my prior job for a major corporation. I’ve used PowerShell to connect to MS SQL, MySQL, Flat Files, Laserfiche, FileNET, you name it and I probably connected to it. I’ve also used it to pull information off of websites. To me it is simple, easy, fast, compact, and extensible. It is my go-to language when I need to develop anything. In fact, I have an extensive invest library built using PowerShell, that I am thinking of writing a book on. Anyway, great article, and a great language.

       

      1 user thanked author for this post.
    • #2574120

      Personally I like using Excel VBA as a programming platform with GUI capability, and VBScript for command line operations.

      It’s fairly easy to write VBA to auto-execute when opening the excel file, and a short VBScript file will open an instance of Excel, run the file and close it, all without interfering with any open Excel files.

      Using USERFORMs to provide a GUI is straight forward.

      Let’s me use my limited self-taught OOP experience from the past 20 years of VBA programming, as well as the 20 years before that programming in BASICA, Visual Basic and PDS 7.1. I know I’m stuck in a rut, but it’s a very comfortable rut.

    • #2574279

      I just haven’t really run into any situations where PowerShell scripts would really be useful. I mostly use batch files to run programs, not to do complicated tasks.

      I definitely wouldn’t see much need in listing files above a certain size on a continual basis. I would most likely just use Explorer and sort by file size, or just use a dir with a sort.

      It also just seems to have Microsoft’s typical overcomplication of everything. Why in the world did you need to specify which file attributes to display, for example?

    • #2574416

      cmd.exe will still rules

      I agree. cmd.exe is the easiest to use.

      Never liked PowerShell. Avoid it and still use cmd.exe. Works better for me. Less clutter in my head.

      I agree. PowerShell is useless and avoid it. Only thing PowerShell is good for is the flaw to bypass and get into system account to make yourself an admin. There is no such bug in cmd.exe

      It also just seems to have Microsoft’s typical overcomplication of everything. Why in the world did you need to specify which file attributes to display, for example?

      MS does not care. It is simple as that. This why the powershell bug to get into system to get admin rights still exists after it was first release back in 2006. MS does not want to fix things or make things simple.

       

    • #2574763

      I’ve been seriously using PowerShell since 2012 to automate tasks in Windows. I have a library of over 20 cmdlets and a 1200 line script I use to wrangle windows to my liking. I began that script in 2015 for Win 10 and, while I think I could do it all from cmd, it would not be simple and would be a lot longer and much harder to maintain. Some examples: uninstalling apps with Remove-AppxPackage, Setting Surface Reduction Rules with Add-MpPreference -AttackSurfaceReductionRules_Ids, Turning on/off Windows Features with Enable-WindowsOptionalFeature, and my favorite, using an array of about 200 elements to add, set, delete registry entries based on build number so it works for 10 & 11. Pretty easy to maintain since the design was to deal with changes.
      I’m pretty certain that I couldn’t manage MS 365 Exchange without PS. I have two MS hosted Exchange accounts so all of my & my spouse’s devices have the same mail, calendar, contact view.
      Every time one of the seven Windows device in the household reboots a scheduled task (set up by my settings script) kicks off a PS script to save to a networked location things like current build, disk utilization, current versions of key software. Makes it easy without logging in to another machine to know that all is up to date.
      I couldn’t/wouldn’t have automated so much with PowerShell. I used to write .bat and 8080 assembler to do stuff. No more.

      2 users thanked author for this post.
    • #2574841

      While CMD.EXE is still GOAT of Windows to me, I must admit that most things can be done in PowerShell and its inaviodable to use it.
      And completing inputs with TAB key made using powershell easy to me, because I could not remember all those complicated commands like Get-AppXPackage 👍

      So until AI replaces my work position, I will use powershell.

      Dell Latitude 3420, Intel Core i7 @ 2.8 GHz, 16GB RAM, W10 22H2 Enterprise

      HAL3000, AMD Athlon 200GE @ 3,4 GHz, 8GB RAM, Fedora 29

      PRUSA i3 MK3S+

    • #2574853

      I haven’t seen mentioned yet in this thread that PowerShell also runs CMD.exe commands quite readily.  And it seems to be able to run them more quickly.

      PowerShell

      Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
      We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
      We were all once "Average Users".

      1 user thanked author for this post.
      • #2574857

        More quickly? external console programs runs in conhost.exe, it doesn’t matter if they launched by cmd.exe or powershell

        try running a batch script in Powershell and see how it mess up things 🙂

        • #2574860

          try running a batch script in Powershell and see how it mess up things

          If by “batch script” you mean “.bat”, PowerShell doesn’t run .bat;

          “win10proa.bat: The term ‘win10proa.bat’ is not recognized as a name of a cmdlet, function, script file, or executable program.
          Check the spelling of the name, or if a path was included, verify that the path is correct and try again.”

          Why would I not use a PowerShell script to run a script in PowerShell?

          Always create a fresh drive image before making system changes/Windows updates; you may need to start over!
          We all have our own reasons for doing the things that we do with our systems; we don't need anyone's approval, and we don't all have to do the same things.
          We were all once "Average Users".

    • #2575157

      If anyone has conhost.exe running in xp or vista, they have a virus
      If anyone running xp or vista is online…there’s the answer :-{

    Viewing 12 reply threads
    Reply To: Why PowerShell?

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: