C:\>cmd-line.com

"Let's learn the Command-Line Interface!"

PowerShell


introduction


How to run PowerShell in Windows 7, 8, 10?

  • Start > write powershell
  • Start > PowerShell
  • PowerShell versions

    version cmdlets included in available for year
    1.0 129 Windows Server 2008 Windows XP
    Windows Server 2003
    Windows Vista
    2006
    2.0 632 Windows 7
    Windows Server 2008 R2
    Windows XP
    Windows Server 2003
    Windows Vista
    Windows Server 2008
    2009
    3.0 about 1000 Windows 8
    Windows Server 2012
    Windows 7
    Windows Server 2008
    Windows Server 2008 R2
    2012
    4.0 ? Windows 8.1
    WIndows Server 2012 R2
    Windows 7
    Windows Server 2008 R2
    Windows Server 2012
    2013
    5.0 about 1300 Windows 10 Windows 7
    Windows 8.1
    Windows Server 2012
    Windows Server 2012 R2
    2016
    5.1 1586 Windows 10 Windows 7
    Windows 8.1
    Windows Server 2008 R2
    Windows Server 2012
    Windows Server 2012 R2
    2017
    Core 6.0 ? Windows 10 Windows
    macOS
    Linux
    2018

    command information


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Get-Help help, man help man display command help
    Get-Command gcm help which lists the available commands

    browsing directories


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Get-Location gl, cd, pwd cd pwd display path to current directory
    Get-ChildItem gci, dir, ls dir ls returns all objects in the current location (e.g. files in the current directory)
    Set-Location sl, cd, chdir cd, chdir cd changes the current location (directory, registry hive, certificate repository)

    file manipulation


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Copy-Item cpi, copy, cp copy cp copies objects (e.g. files) or a structure fragment (e.g. directory tree)
    Move-Item mvi, move, mv move mv moves file / directory to new location
    Rename-Item rni, ren ren, rename mv renames an object (file, directory, etc.)
    Remove-Item ri, del, rd, rmdir, rm del, erase, rd, rmdir rm, rmdir deletes an object (file, directory, etc.)

    reading files


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Get-Content gc, type, cat type cat display the content of an object (e.g. a file)

    console

    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Clear-Host cls, clear cls clear clears the screen

    system


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Set-Variable sv, set set set creates or alters the contents of an environment variable

    network


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Test-Connection ping ping ping sends a ping request (ICMP Echo Request) from the user's computer to a specific device, or issues a command to another device to perform this operation
    Invoke-WebRequest iwr, curl, wget curl, wget downloads the content of the website

    processes


    PowerShell cmd.exe /
    COMMAND.COM
    linux
    (bash)
    description
    cmdlet alias
    Get-Process gps, ps tasklist ps lists the currently running processes
    Stop-Process sps, kill taskkill kill stops the running process