user1552869
user1552869

Reputation: 335

Open PowerShell from Run Window

I was looking for a command to fire up PowerShell from the Run window.
I type in 'powershell' in run window.
And it does fire up Windows PowerShell - but why it looks like 'Command Prompt' window(Black background).
Why I am missing that blue screen that comes when I open PowerShell from Accesssories->Windows PS?

Any ideas?

Upvotes: 1

Views: 2524

Answers (4)

NQP
NQP

Reputation: 1

Typing in PowerShell from the Windows command line will execute PowerShell, however it will keep the same style, i.e., black background.

If you search for PowerShell in your Start Menu it will pull all actual programs available, PowerShell and PowerShell ISE (blue backgrounds).

Upvotes: 0

Michał Pawlak
Michał Pawlak

Reputation: 106

You can set window properties in your profile. There is possible to set background color, font color, buffer,window size, ... Check if you already have profile file:

Test-Path $profile

If not create it:

New-Item -path $profile -type file -force

Now you can edit profile:

notepad $profile

Example of profile settings:

$Shell = $Host.UI.RawUI
$size = $Shell.BufferSize
$size.width=120
$size.height=3000
$Shell.BufferSize = $size
$size = $Shell.WindowSize
$size.width=120
$size.height=50
$Shell.WindowSize = $size
$shell.BackgroundColor = “Magenta”
$shell.ForegroundColor = “White”
cls

As you can see it is normal powershell script so you can set other properties and execute other commands.

Upvotes: 1

John Dahl
John Dahl

Reputation: 31

The blue screen you are used to seeing is configured in the shortcut, not in the PowerShell executable. By starting PowerShell from the Run dialog box instead of the shortcut, you are not going to see the shell configuration options that are defined in the shortcut.

One way to control how your PowerShell window appears is to setup your profile to set the values you want. You can control the foreground (text) and background colors, font style and size, window position and size, etc. The Microsoft manual covering the profile is located here.

This will make your window appear the same way whether you use a shortcut or the Run dialog. FYI... you can still start a session without the profile if you decide you need to.

Upvotes: 1

Ken White
Ken White

Reputation: 125689

You're looking for PowerShell ISE, not PowerShell.

Powershell:

Powershell screen image

Powershell ISE:

Powershell ISE screen image

Instead of typing PowerShell into the run window, type PowerShell_ISE.

Upvotes: 4

Related Questions