Difference between Windows PowerShell and Command Prompt


  1. Posts : 30
    Windows 10 Home
       #1

    Difference between Windows PowerShell and Command Prompt


    Don't these programs do essentially the same thing? Is there an advantage to use one over the other? Just curious.
      My Computer


  2. Posts : 5,452
    Windows 11 Home
       #2

    CMD is easier to use (less code), but PS gives you more power/features.
    CMD is being slowly deprecated, so MS will move to PS eventually (~5 years).

    I wholeheartedly prefer CMD, but I am preparing to move to PS. You might like this:
    Code:
    https://books.goalkicker.com/PowerShellBook/PowerShellNotesForProfessionals.pdf
      My Computer


  3. Posts : 2,068
    Windows 10 Pro
       #3

    Powershell is considerably different from the command line interface in Windows. With powershell, you have the ability to use cmdlets which allow you to perform many systems admin tasks, you can modify the registry and utilize WMI (Windows Management Instrumentation). These things cannot be modified via the command line.

    Powershell returns everything as an object and you can pipe the objects from one cmdlet through another cmdlet. It acts far more like a programming language.


    This command will show you all stopped services on your system.
    get-service |Where-Object {$_.status -eq "stopped"}

    This will display all processes to you in the color cyan
    Get-Process | ForEach-Object {Write-Host $_.name -foregroundcolor cyan}

    Want to see who last rebooted your workstation or your server
    Get-EventLog –Log System –Newest 1000 | Where-Object {$_.EventID –eq ‘1074’} | FT MachineName, UserName, TimeGenerated -AutoSize
      My Computers


  4. Posts : 5,452
    Windows 11 Home
       #4

    pparks1 said:
    These things cannot be modified via the command line.
    Sure you can, but it will not be so fancy like with PS, like:
    This command will show you all stopped services on your system.
    Code:
    wmic service where started=false get name, startname
      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 07:38.
Find Us




Windows 10 Forums