Install and Configure PowerShell and PowerShell ISE via the WMF
WMF 5.1, The Following is for Earlier Windows Users!
I do usually use Powershell as opposed to Command Prompt, either as elevated to Admin, and it CAN be Installed on W 7. See the Following:
NOTE: If you are using W 10, you have at least WMF 5,x, on 1507 or Greater;
WMF 5.1 RTM | Windows Management Framework 5.1
Install and configure WMF 5.1
https://msdn.microsoft.com/en-us/powershell/wmf/5.1/install-configure
Windows Management Framework (WMF) 5.1 Released | Windows PowerShell Blog
https://blogs.msdn.microsoft.com/powershell/2017/01/19/windows-management-framework-wmf-5-1-released/
WMF 5.1 Release Notes
https://msdn.microsoft.com/en-us/powershell/wmf/5.1/release-notes
PowerShell Magazine » Comparing commands between PowerShell versions
http://www.powershellmagazine.com/2016/04/29/comparing-commands-between-powershell-versions/
PowerShell Gallery | Home
https://www.powershellgallery.com/
Get Started with the PowerShell Gallery | MSDN
https://msdn.microsoft.com/en-us/powershell/gallery/psgallery/psgallery_gettingstarted
The PowerShell Gallery | MSDN
https://msdn.microsoft.com/en-us/powershell/gallery/readme
There are many more but one will find them through all of the above, for those whom are interested. Also keep a watch on @jsnover on Twitter the Father of Powershell.
For clarification, I am still a novice BUT I do find PS and PS ISE(for the Module memory joggers) fascinating. However I do prefer GUI’s the most.
Now that you have Powershell installed and available one needs to make it accessible.
That is done in two ways, in the Group Policy and in Powershell itself.
First Group Policy:
Start “C:\Windows\System32\en-US\gpedit.msc”
Find Both for Enabling Powershell Scripts and Modules:
Computer Components>Administrator Templates>Windows Components>Windows Powershell=
User Configuration>Administrator Templates>Windows Components>Windows Powershell=
Turn On Script Execution>Enabled & Allow Local Scripts and Remote Signed Scripts.
(If you require all scripts to be Signed then you will have digitally Sign all of your own Scripts! One should never Allow All Scripts to Run, it is just to dangerous in this day and age).
I also like to Turn On Module Logging>Enabled
(This will right appropriate Event in the Events Log. This can be handy for Tracing, Tracking and diagnoses).
Powershell ISE and “Get-ExecutionPolicy” in the inboard Module: Microsoft.Powershell.Security
Open: Windows Powershell ISE in Elevated Admin (If you are on an x32 OS, you should only have x32) {On x64 OS, I try to stick to x64 Apps}
Under Modules look for “Microsoft.Powershell.Security” >> Click “Get-ExecutionPolicy” >> “Show Details” >> check off “List” >> Run (at the bottom of the Right Column)
One should see something along these lines:
PS C:\> Get-ExecutionPolicy -List
Scope ExecutionPolicy
—– —————
MachinePolicy RemoteSigned (one may want to keep this ‘Undefined’)
UserPolicy RemoteSigned (this is the minimum that one must have to work in Powershell)
Process Undefined
CurrentUser Undefined
LocalMachine Undefined
ExecutionPolicy: ‘Undefined’ or ‘AllSigned’ or ‘RemoteSigned’ or ‘Restricted’ or ‘Default’ or ‘Bypass’
NEXT: look in the Module for “Set-ExecutionPolicy” >> Click it.
Decide which Scope should have which ExecutionPolicy. Copy & Paste works wonders, then Click Run. Repeat as many times as one needs to.
OR
The Direct PowerShell method is available by:
Open: Windows Powershell and C&P:
“Get-ExecutionPolicy” it will return the ‘ExecutionPolicy’
RemoteSigned
Add a ‘-List’:
Get-ExecutionPolicy -list
Scope ExecutionPolicy
—– —————
MachinePolicy RemoteSigned
UserPolicy RemoteSigned
Process Restricted
CurrentUser Undefined
LocalMachine Undefined
C&P “Get-help Get-ExecutionPolicy -Detailed”
……..
Example 1: Get the current execution policy
PS C:\>Get-ExecutionPolicy
Restricted
This command gets the current execution policy for the computer.
Example 2: Set the execution policy
PS C:\>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
PS C:\>Get-ExecutionPolicy
RemoteSigned
These commands set a new user preference for the execution policy and then display the effective execution policy. In this example, because there is no Group Policy setting, the user preference is the
effective policy for the computer.
Example 3: Get all execution policies for the current session
PS C:\>Get-ExecutionPolicy -List
Scope ExecutionPolicy
—– —————
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser AllSigned
LocalMachine RemoteSigned PS C:\>Get-ExecutionPolicy
AllSigned
These commands get all execution policies in the current session and the effective execution policy.
The first command gets all execution policies that affect the current session. The policies are listed in precedence order.
The second command gets only the effective execution policy, which is the one set in the CurrentUser scope.
Example 4: Prevent a unsigned script from running
C&P Get-help Set-ExecutionPolicy -Detailed
NAME
Set-ExecutionPolicy
SYNOPSIS
Changes the user preference for the Windows PowerShell execution policy.
………
Example 1: Set the shell execution policy
PS C:\>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
This command sets the user preference for the shell execution policy to RemoteSigned.
Example 2: Set a shell execution policy that conflicts with the group policy
PS C:\>Set-ExecutionPolicy -ExecutionPolicy Restricted
Set-ExecutionPolicy : Windows PowerShell updated your local preference successfully, but the setting is
overridden by the group policy applied to your system. Due to the override, your shell will retain its current
effective execution policy of “AllSigned”. Contact your group policy administrator for more information.
At line:1 char:20
C&P “Get-ExecutionPolicy” it will return the ‘ExecutionPolicy’
RemoteSigned
This Gets one Started so one can use Powershell and Powershell ISE and various Scripts and Modules
--------------------------------------
1. Tower Totals: 2xSSD ~512GB, 2xHHD 20 TB, Memory 32GB
SSDs: 6xOS Partitions, 2xW8.1 Main & Test, 2x10.0 Test, Pro, x64
CPU i7 2600 K, SandyBridge/CougarPoint, 4 cores, 8 Threads, 3.4 GHz
Graphics Radeon RX 580, RX 580 ONLY Over Clocked
More perishable
2xMonitors Asus DVI, Sony 55" UHD TV HDMI
1. NUC 5i7 2cores, 4 Thread, Memory 8GB, 3.1 GHz, M2SSD 140GB
1xOS W8.1 Pro, NAS Dependent, Same Sony above.
-----------------