How to open PowerShell, all methods. What is Windows PowerShell - how to launch it and use basic commands How to open powershell in Windows 10

How to open PowerShell from the Win + X menu

This method is very convenient in Windows 10. Starting from Windows 8, Microsoft introduced the “Power Users” menu, which contains many useful elements such as “Control Panel”, “ Network connections", etc. Of course, Windows 10 also has such a menu. It contains a PowerShell element and a PowerShell (administrator), the latter is exactly what we need.

To access this menu on Windows 10, press the Win + X keyboard shortcuts.

In the menu that opens, click on the item PowerShell (administrator).

Opening PowerShell using Search in Windows 10.


In Windows 10, you can use the search icon on the taskbar. Click on the search icon and Type PowerShell, press CTRL + SHIFT + ENTER to run PowerShell as administrator.

This also works in the start menu, just start typing PowerShell, then click right click mouse over the view that appears Windows PowerShell and select Run as Administrator.

Launch an instance of PowerShell from Windows 10 Explorer


You can launch PowerShell from Explorer. You may wonder why you need this. Let me show you a sample scenario.

Windows PowerShell and command line Windows 10 - basic setup and management.

Quite experienced Windows users, of course, remember the MS-DOS command line, although perhaps these memories are not so pleasant. But even after 20 years of trying to screw up the Command Prompt, Windows 10 still rewards those who understand the benefits of using the Command Prompt for some common tasks.

As all system administrators know, typing a command is faster than using GUI, and this is even more true for scripts that can execute a whole sequence of commands. Windows 10 includes the next generation of Windows PowerShell, which offers tremendous power to those willing to spend a little time learning its commands.

Command Windows processor - cmd.exe, looks similar to its ancient ancestor, MS-DOS. On a 64-bit Windows 10 system, Cmd.exe is native Windows process 64-bit. The easiest way to open the command line is the "Quick Links" menu (right-click "Start" or use the combination Windows keys+ X). This menu has two command line options. One runs under your user account and the second runs with administrator rights.

You can also enter in the search field cmd and then, in the list of results, click " Command line". Or right-click on the element and then, in the context menu, select "Open as administrator" to open an elevated command prompt window. The visible difference between these two methods is the administrator prefix that appears in the title bar of the command line session. You can see these changes in the image below, where the properties settings for the Command Prompt window are open by right-clicking the icon on the left side of the title bar and then selecting Properties.

To change the command line color scheme from the retro green/black combination, use the color tab. (Look at the file dates in the preview window!)

How to go from Explorer to the command line with two clicks

You are in Explorer. And want to open a command prompt window in the current folder. Luckily, there's a shortcut for this. Hold down the Shift key and right-click on any free space in the folder (make sure no files are selected), and then select Open Command Window from the context menu.

If you don't know what you can do in the Windows 10 Command Prompt window, type " help" A list of 84 commands appears with brief description for each of them. Want to know the full syntax for the command? In the Command Prompt window, enter the name of the command followed by the switch /? .

The Command Prompt is useful for some file management tasks, and its syntax hasn't changed much since the days of MS-DOS. For example, using wildcards, using the command Ren*.htm*.html, you can change the extension of a group of files in a folder. This work is almost impossible in .

There are a few commands that you probably don't know, but they can be very useful. The following list contains several such commands:

 . This handy command outputs detailed description current system. Including host name, Windows version and original installation date, domain membership, or working group, network details and much more. The image below shows a small portion of the possible output of this command. Enter the command with " > " followed by the full path to the destination file to save the results to a file that you can view later.

The output for the Systeminfo command contains much more detail than the snippet shown here. Redirect output to text file to save the information for future use.

Driverquery. If you are wondering what drivers are installed on a given system (local or remote), this command will help you. Use /FO CSV to indicate that you want to output data in comma-separated value (CSV) format. Redirect the output to a file and you can open it for more detailed analysis in Excel.

Icacls. This oddly named command lets you manage permissions (access control lists, or ACLs) on files and folders. If you are unable to delete or rename a file or folder due to permission, this command will help you.

 . Sometimes the Power menu doesn't have the options you really need. This command, with different switches ( /r to reboot and /s to turn off) can cover the desired scenarios. Using the parameter /t, you can specify the time to wait (in seconds) before executing the command. (The default is 30 seconds.) If you have multiple tasks and want your computer to restart after 15 minutes, use the command shutdown /r /t 900. If you change your mind, use it to cancel a scheduled shutdown or reboot.

Sc. With this command, you can query, start, pause, stop, and configure services using the Service Control Manager. Its syntax is complex, but its capabilities are extremely powerful.

Tasklist And Taskkill. Using these commands you can create a list of running tasks and then forcefully terminate any process on that list. Taskkill is a blunt weapon, but very effective at the right moment.

To navigate the Command Prompt window faster, it's worth learning how the arrow keys work. Use up and down arrows to scroll and repeat last command. Use the right arrow button to repeat the previous command one character at a time, which can save you time if you need to repeat the command with a different parameter or switch. Finally, after repeating or typing a command, but before pressing Enter, use the left and right arrows to move through the command and make changes as needed. When editing a command, press the Insert key to switch between replace mode (in which everything you type replaces the existing contents of the command line) and insert mode, which appends what you type without disturbing the current command.

Windows PowerShell

Windows 10 Command Prompt can trace its lineage back more than three decades. The much more modern Windows PowerShell, version 1.0, appeared just ten years ago.

An incredibly rich PowerShell environment built for system administrators, automating their tasks and system configuration. Instead of a limited number of commands, Windows PowerShell offers cmdlets that work with file system, registry, certificate stores and almost any Windows component (desktop and server). Cmdlets are available in the core modules that come with every edition of Windows 10. And of course, the real challenge for many of them is the ability to combine cmdlets into scripts. If you are an administrator, you can use these scripts to quickly and efficiently complete repetitive management tasks.

If you're not a system administrator, Windows PowerShell can be intimidating. But some tasks, including managing Microsoft Azure and Office 365, for Windows commands PowerShell is perfect. Let's just get acquainted with the basics of Windows PowerShell.

Windows PowerShell includes its own command line environment, with a distinctive blue background that is installed separately from the Windows 10 Command Prompt. As shown in the image below, one of the first things anyone new to Windows PowerShell should do is display a cmdlet Get-Help, including a link to online help And detailed instructions to use the cmdlet Update-Help.

Use the Get-Help cmdlet to get started in an interactive Windows PowerShell command-line environment.

Add the word Get-Help to the end and you can find cmdlets that include that term. If you know there is a cmdlet for managing but don't exactly remember it, try Bitlocker Get-Help to display this list. Using the syntax Get-Help -online , you can go directly to the online reference and get information about a specific cmdlet.

If you are not sure of the exact cmdlet name, you can press the Tab key and use IntelliSense. For example, enter get-p and press Tab to see the first matching cmdlet, Get-Package. Keep the Tab key pressed and scroll through the entire loop: Get-PackageProvider, Get-PackageSource and so on.

If you need more help, consider using Integrated Scripting (ISE) Windows environment PowerShell, which offer a graphical interface and many prompts when typing cmdlets. The picture below shows Windows PowerShell ISE with the command window and cmdlet open on the right Get-MpComputerStatus from module. You don't need to enter a cmdlet here. Simply select it from the list and click “Run”.

WITH using Windows PowerShell ISE, you can dock the command window with the shell so that you can view the cmdlets in the module and click Run or Paste.

If you prefer a floating window instead of a docked panel, on the toolbar, click the Show Command Window button (second from the right). As shown in the picture, here you can see the full selection of modules.

Although the Windows PowerShell ISE is specifically designed for creating Windows PowerShell scripts, its Commands add-in serves as a useful learning tool.

Hi all! Today a short note on the topic, how to open powershell as administrator. Let me remind you that PowerShell is a powerful programming and administration language from Microsoft, every year it grows, everything large quantity cmdlets and functionality. Essentially, it is a replacement for the Windows Command Prompt. Below we will consider methods that allow you to open and configure it.
.

Methods for opening a PowerShell snap-in

Powershell is developing very well and with the release of Windows 10 it has already received version 5, but our topic is different. So how to open powershell? Everything is simple if in Windows XP, then nothing. Since it is delivered separately, in all subsequent releases it comes as a built-in component. Most universal method open powershell this click

Win+R and enter powershell

By pressing enter, the PowerShell console will launch, the only problem is that it will not open as administrator. And as a result, many commands will not be executed; below we will see how to do this on behalf of the administrator.

How to run windows powershell as administrator in Windows 8.1 and Windows 7

You can open Windows Powershell through Start. In Windows 8.1, Windows 2012 R2, go to System Tools - Windows and right-click and select Run as administrator.

In Windows 7 and Windows 2008 R2 it looks like this Start > Accessories > Windows PowerShell

You can also create a shortcut in the task item and right-click on it and select the appropriate item

It would be convenient if PowerShell always opened as administrator, let's implement it. This is done the same way in all versions of Windows. Opening the control panel

Right-click on it and select Properties. You can immediately see the path to the file where it is located in the system.

Click the "Advanced" button. You will see additional properties. where you need to check the box Run as administrator.

Everything is very simple. I am sure that now you will not have a question about how to open Windows Powershell. Another useful thing is to change the font in the powershell window.

How to Open PowerShell from the Start Button Context Menu in Windows 10

Microsoft is increasingly placing emphasis from the command line towards its strong language (PowerShell), and this is logical, since its capabilities for managing operating systems Windows family, are almost limitless, if not more, than in the graphical interface. Beginning with Windows versions 10 1709, in the context menu, PowerShell, replaced the usual cmd for everyone. Right click on the start button in Windows 10 and from context menu, select the appropriate item:

  1. Windows PowerShell
  2. Windows PowerShell (administrator) is exactly the mode with maximum rights in Windows 10.

Launch Windows PowerShell using Search in Windows 10

In Windows 10 and older versions, you can find the PowerShell shell using a regular search; there is a special section for this. Click next to the Start button, the magnifying glass icon. In the search form that opens, enter the word PowerShell. You will search for all options, among which you will find the shell. If you right-click on it, you can open it as an administrator.

Launching Windows PowerShell from the Start menu in Windows 10

To open PowerShell from the Start menu, open it and find the Windows PowerShell item, it will be in the form of a folder, open it and run the appropriate version.

If you right-click, you can run the Vershel shell as an administrator with administrator rights.

Additional and generic shell launch methods

There are also very specific methods for opening a shell with a powerful language from Microsoft. The most clumsy one, it's easy to find executable file and run it directly from a location on the system. Let's go to your Windows 10 along the following path:

C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell

As a result, you will see a folder with shortcuts that are present in the Start menu, you can launch them.

You can also run the original executable file, which is located along the path:

C:\Windows\System32\WindowsPowerShell\v1.0

And by right-clicking on it, you can download it as an administrator, with maximum rights.

You can also launch Windows PowerShell from the command line window; to do this, simply enter the magic word in it and press Enter.

Well, let me also remind you of the method for launching a new task from the “Task Manager” snap-in. Open "Task Manager", select menu item "File - Run" new task"

In the window that appears, enter PowerShell.

Well, the last method known to me is to launch PowerShell through Windows 10 Explorer, to do this, open Explorer, select the menu item “File - launch Windows PowerShell”, there will be both modes.

The responsible administrator always has two accounts, the first one has the minimum rights of an ordinary user for everyday tasks. The second one already has the necessary administrative privileges, from which he configures servers and everything related. In operating rooms Windows systems There is functionality that allows you, while in the session of one user, to launch the application on behalf of another, who has more advanced rights. So in session regular user, System Administrator launches PowerShell as a user with different rights and quietly manages what he wants.

To run PowerShell as another user, you need to hold down the SHIFT button, then right-click on the PowerShell icon and select "Run as another user" from the context menu.

Enter the login and password for the account you need. As a result, the shell will work in the context of another user.

You can also launch a new PowerShell window from the current user window, but with new rights, to do this, enter the command:

start powershell -credential ""

In the account request window, indicate the login and password for the account that has the rights you need for your further work.

What is PowerShell ISE

You've probably noticed that the PowerShell ISE shortcut is everywhere, and you'd like to know what it is. In a nutshell, this is a special shell in which you can write scripts and scripts in the PowerShell language, using all the variety of cmdlets that offers you Microsoft company.

One of the convenient methods for launching PowerShell, if used very often, is to assign a hotkey combination to it, which, when pressed, launches the shell. It's done, it's very simple. Open the window properties PowerShell, on the " tab Label"find item" Quick call", by default it has the status no.

Select it and press the Shift or Ctrl, or CTRL+SHIFT key, as a result of which you will substitute the construction for the future combination and also press any key from the letter range, in my example it turned out CTRL + SHFT + C. This is the combination I will call your PowerShell. Save the settings. I also note that you can easily cancel it or change it to another.

I'm trying to enter the shortcut combination CTRL + SHFT + C, as I see everything works great.

Launching a shell from ISE

Until recently, I usually opened ISE from the usual PowerShell shell, and not vice versa, but what a surprise I was that in my “File” I found the item “Run PowerShell.exe” and there is even a keyboard shortcut Ctrl+Shift+P.

Powershell changing the font is very simple, go to the Font tab in the properties, where you can set the size from 5 to 72.

You can also get to the properties from the utility window itself, click on the icon in the left top corner and select properties

Here the font settings are slightly different, and as they change, the size of the console also changes.

On the Colors tab, you can set the font color in Powershell and the window itself. By making it black, for example, like the command line.

I also advise that if you are an active console user, set the buffer size not to 50 commands, but at least to 100.

Starting with Windows 10 1809, Microsoft changed the way the RSAT (Remote Server Administration Tools) package is installed. Previously, after each upgrade of the Windows 10 build (for example, from 1809 to 1903), you had to manually download the msu package with the latest version of the distribution kit with RSAT and install it on your computer, but now the following message appears on the RSAT download page on the Microsoft website:

IMPORTANT: Starting with Windows 10 October 2018 Update, RSAT is included as a set of “Features on Demand” in Windows 10 itself.

RSAT in Windows 10 as Features on Demand (FoD)

The fact is that, starting with Windows 10 1809 (17763), you no longer have to manually download latest version RSAT from Microsoft website. Remote Server Administration Tools is now built into Windows image 10 and is installed as a separate option ( Features on demand / Features on Demand). Installation of RSAT is possible from the application Options.

Windows 10 distribution does not include setup files RSAT, to install them, your computer needs direct access to the Internet. In addition, you cannot install RSAT in Windows 10 Home edition; only Professional and Enterprise editions are suitable.

To install RSAT on Windows 10 1809, you need to go to the section Settings -> Apps -> ManageOptionalFeatures -> Addafeature (Windows Settings-> Applications -> Additional features-> Add component). Here you can select and install the tools you need from the RSAT package.

The following administration tools are available:

  • RSAT: Active Directory Domain Services and Lightweight Directory Services Tools
  • RSAT: BitLocker Drive Encryption Administration Utilities
  • RSAT: Active Directory Certificate Services Tools
  • RSAT: DHCP Server Tools
  • RSAT: DNS Server Tools
  • RSAT: Failover Clustering Tools
  • RSAT: File Services Tools
  • RSAT: Group Policy Management Tools
  • RSAT: IP Address Management (IPAM) Client
  • RSAT: Data Center Bridging LLDP Tools
  • RSAT: Network Controller Management Tools
  • RSAT: Network Load Balancing Tools
  • RSAT: Remote Access Management Tools
  • RSAT: Remote Desktop Services Tools
  • RSAT: Server Manager
  • RSAT: Shielded VM Tools
  • RSAT: Storage Migration Service Management Tools
  • RSAT: Storage Replica Module for Windows PowerShell
  • RSAT: System Insights Module for Windows PowerShell
  • RSAT: Volume Activation Tools
  • RSAT: Windows Server Update Services Tools

Installing RSAT on Windows 10 using PowerShell

You can install the RSAT administration components using PowerShell. In this example, we will show you how to manage RSAT components on Windows 10 1903.

You can use the following command to check if RSAT components are installed on your computer:

You can imagine the status installed components RSAT in a more convenient table:

Get-WindowsCapability -Name RSAT* -Online | Select-Object -Property DisplayName, State

As you can see, the RSAT components are not installed (NotPresent).

You can use the Add-WindowsCapacity cmdlet to set these Windows options.

To install a specific RSAT tool, such as AD management tools (including the console and ), run the command:

Add-WindowsCapability –online –Name “Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0”

To install the DNS and Management Console, run:

Add-WindowsCapability –online –Name “Rsat.Dns.Tools~~~~0.0.1.0”

Add-WindowsCapability -Online -Name Rsat.BitLocker.Recovery.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.CertificateServices.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.DHCP.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.FailoverCluster.Management.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.FileServices.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.IPAM.Client.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.LLDP.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.NetworkController.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.NetworkLoadBalancing.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.RemoteAccess.Management.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.RemoteDesktop.Services.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.ServerManager.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.Shielded.VM.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.StorageMigrationService.Management.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.StorageReplica.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.SystemInsights.Management.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.VolumeActivation.Tools~~~~0.0.1.0
Add-WindowsCapability -Online -Name Rsat.WSUS.Tools~~~~0.0.1.0

To install everything at once available tools RSAT, run:

To install only the missing RSAT components, run:

Get-WindowsCapability -Online |? ($_.Name -like "*RSAT*" -and $_.State -eq "NotPresent") | Add-WindowsCapability -Online

Now make sure that the RSAT tools are installed (status Installed);

After this, the installed RSAT tools will be displayed in the panel ManageOptionalFeatures.

Error 0x800f0954 when installing RSAT on Windows 10

If you have Internet access on Windows 10 desktops, but installing RSAT via Add-WindowsCapability or DISM (DISM.exe /Online /add-capability /CapabilityName:Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0 .1.0), you see an error 0x800f0954, this means your computer is configured to update from local using .

To correctly install RSAT components in Windows 10 1809+, you can temporarily disable updating from the WSUS server in the registry (HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU parameter UseWUServer= 0) and restart the update service.

You can use this PowerShell script:

$val = Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" | select -ExpandProperty UseWUServer
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 0
Restart-Service wuauserv
Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value $val
Restart-Service wuauserv

Or you can customize new parameter GPO, which allows you to configure installation options for additional Windows components and Features On Demand (including RSAT).


Installing RSAT via PowerShell or Dism should now complete without errors.

Installing RSAT in Windows 10 offline

If you encounter the Add-WindowsCapability failed error when installing RSAT. Error code = 0x800f0954, or you don’t see RSAT in the list of additional components ( No components required for installation), most likely your computer is configured to receive updates from the internal WSUS/SCCM SUP server.

Let's look at how to install RSAT in Windows 10 1903 offline ( corporate network without direct access to the Internet).

To install RSAT offline you need to download ISO image disk with FoD for your version of Windows 10 from your personal account on the Microsoft licensing website - Volume Licensing Service Center (VLSC). The image is called something like this: Windows 10 Features on Demand, version 1903.

For example, for Windows 10 1903 x64 you need to download an image SW_DVD9_NTRL_Win_10_1903_64Bit_MultiLang_FOD_.ISO(about 5 GB). Unpack the image into network folder. You will end up with a set of many *.cab files.

Now, to install RSAT components on a Windows 10 desktop, you need to specify the path to this network directory with FoD. For example:

Add-WindowsCapability -Online -Name Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0 -LimitAccess -Source \\msk-fs01\Distr\Windows-FOD\Win101903x64\

You can also specify the path to the directory with FoD components using the above group policy. For this purpose in the steamer Alternativesourcefilepath you need to specify the UNC path to the directory.

Or you can set this parameter through the registry by specifying the directory path in the parameter LocalSourcePath(type REG_Expand_SZ) in the registry branch HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Servicing.

After this, users will be able to independently install RSAT components through the graphical interface for adding Windows 10 components.