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,732
    313
    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.
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    47,232
    94,598
    450
  3. MELERIX

    MELERIX MDL Expert

    Nov 7, 2011
    1,217
    653
    60
    Powershell is just CMD Plus.
     
  4. vuze4u

    vuze4u MDL Member

    Apr 24, 2010
    140
    36
    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 Expert

    Sep 16, 2018
    1,168
    752
    60
    Powershell is much more powerful than cmd. Learn how to use it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. pf100

    pf100 Duct Tape Coder

    Oct 22, 2010
    2,069
    3,447
    90
    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
    396
    233
    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 Expert

    Sep 16, 2018
    1,168
    752
    60
    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"
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    And a liability full of vulnerabilities that gives leverage to bad actors aka malware :tooth:
     
  11. rayleigh_otter

    rayleigh_otter MDL Expert

    Aug 8, 2018
    1,121
    933
    60
    :tooth:
     
  12. GodHand

    GodHand MDL Addicted

    Jul 15, 2016
    534
    926
    30
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. sebus

    sebus MDL Guru

    Jul 23, 2008
    6,356
    2,026
    210
    The difference is like Wordpad & Word.
     
  14. shewolf

    shewolf MDL Senior Member

    Apr 16, 2015
    471
    1,066
    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 Senior Member

    Aug 10, 2009
    423
    252
    10
    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 Senior Member

    Jul 8, 2007
    450
    346
    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
    954
    1,673
    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...