PowerShell vs CMD - what's the real difference?

Discussion in 'Windows 10' started by MonarchX, Dec 31, 2018.

  1. MonarchX

    MonarchX MDL Expert

    May 5, 2007
    1,514
    260
    60
    I just downloaded the latest PowerShell 6.2.0 Preview 3 and its just like CMD, so what is the real difference and what the advantage of it? I assume the one I downloaded is newer than the one in Windows 10 1607.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    20,109
    27,163
    390
  3. MELERIX

    MELERIX MDL Addicted

    Nov 7, 2011
    874
    396
    30
    Powershell is just CMD Plus.
     
  4. vuze4u

    vuze4u MDL Member

    Apr 24, 2010
    129
    32
    10
    #4 vuze4u, Jan 1, 2019
    Last edited: Jan 1, 2019
    Some cmd functions got removed and only works with PS. When i compiled 1607 LTSB with NTLite i checked remove PS thinking cmd is still viable, months later "aw crap" was my respond to that mistake.

    Edit: I remember bit was also for security reasons. I don't remember exactly but was something about PS scripts is easier to exploit and execute than cmd bat. Not that i have solid information but i think PS security should be more steady these days.
     
  5. boyonthebus

    boyonthebus MDL Member

    Sep 16, 2018
    232
    115
    10
    Powershell is much more powerful than cmd. Learn how to use it.
     
  6. pf100

    pf100 MDL Expert

    Oct 22, 2010
    1,478
    2,070
    60
    Unless you're someone like me who already knows CMD and powershell offers nothing that I need. If I had a career in programming, sure powershell would be good to know. But why write a script in powershell if you can do the same with CMD and it'll run faster? So it really needs to be decided on a case by case basis. Not only is powershell much more powerful, it's much more slower.
     
  7. Krager

    Krager MDL Senior Member

    Jan 9, 2017
    374
    211
    10
    Definitely, but I just can't seem to motivate on that. Good old cmd has been around since the mountains, hard to give up what you're used to.
     
  8. boyonthebus

    boyonthebus MDL Member

    Sep 16, 2018
    232
    115
    10
    Powershell lets you use wild cards easily in some instances such as this
    Code:
    powershell -command "get-childitem -path C:\windows\winsxs -include *defender* -recurse | remove-item -recurse -force -confirm:$false"
     
  9. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    427
    473
    10
    There are far too may differences to post here, but in short the major difference is PowerShell is built on .NET and thus can take any Windows task and add automation and logic to it. This is eons beyond what cmd (command-line) can do.

    PowerShell offers complete automation, data manipulation, full administrative control of Exchange, Active Directory, Citrix, etc. locally and across networks, code-wrapping, namespace and kernal access and control, etc.

    PowerShell is heavily driven on internal error handling which can negligibly affect processing speed. Moreover, each time PowerShell is loaded, it automatically loads all cmdlets and modules into the active session.

    The list goes on.
     
  10. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    6,283
    13,945
    210
    And a liability full of vulnerabilities that gives leverage to bad actors aka malware :tooth:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. rayleigh_otter

    rayleigh_otter MDL Senior Member

    Aug 8, 2018
    360
    342
    10
    :tooth:
     
  12. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    427
    473
    10
    According to the most recent white-papers on malware attacks, over 60% occurred by running the PowerShell script/commands from cmd, not from a PowerShell shell.
     
  13. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,994
    1,827
    180
    The difference is like Wordpad & Word.
     
  14. shewolf

    shewolf MDL Senior Member

    Apr 16, 2015
    387
    925
    10
    anyone who does not know the difference does not even have to know it :p
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. ohenry

    ohenry MDL Novice

    Aug 10, 2009
    19
    11
    0
    I personally like and use tccle from JPSoft. I have been using their command shell since the days of 4dos. My day job is supporting technical applications under unix, but I am doing more support these days of Windows applications, so I have been learning Powershell. It is indeed a very powerful tool, and in some ways a more useful scripting language under Windows than even Perl. I attempted to switch over and use powershell instead of tccle, but I ran into too many road blocks.

    YMMV
     
  16. oilernut

    oilernut MDL Member

    Jul 8, 2007
    171
    146
    10
    Malware will always have a way to run, majority being batch files, vbs files and javascript.
     
  17. Atari800XL

    Atari800XL MDL Addicted

    Apr 3, 2011
    714
    1,187
    30
    I agree!!! TCC/LE is absolutely amazing, it deserves a lot more attention, I always thought Microsoft should have hired Rex Conn years and years and years ago!!
    Nice to see another TCC/LE fan here...