Gets the execution policies for the current session. (Get-ExecutionPolicy)

   

# NAME
Get-ExecutionPolicy

# SYNOPSIS
Gets the execution policies for the current session.

# SYNTAX
Get-ExecutionPolicy [[-Scope] {Process | CurrentUser | LocalMachine | UserPolicy | MachinePolicy}] [-List] [<CommonParameters>]

# DESCRIPTION
The Get-ExecutionPolicy cmdlet gets the execution policies for the current session.

The execution policy is determined by execution policies that you set by using Set-ExecutionPolicy and the Group Policy settings for the Windows PowerShell execution policy. The default value is "Restricted."

Without parameters, Get-ExecutionPolicy gets the execution policy that is effective in the session. You can use the List parameter to get all execution policies that affect the session or the Scope parameter to get the execution policy for a particular scope.

For more information, see about_Execution_Policies.

# PARAMETERS
-List [<SwitchParameter>]
Gets all execution policy values for the session listed in precedence order. By default, Get-ExecutionPolicy gets only the effective execution policy.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

-Scope <ExecutionPolicyScope>
Gets the execution policy in the specified scope. By default, Get-ExecutionPolicy gets the effective execution policy for the current session.

Valid values are:

-- MachinePolicy: The execution policy set by a Group Policy for all users of the computer.
-- UserPolicy: The execution policy set by a Group Policy for the current user of the computer.
-- Process: The execution policy that is set for the current Windows PowerShell process.
-- CurrentUser: The execution policy that is set for the current user.
-- LocalMachine: The execution policy that is set for all users of the computer.

Required? false
Position? 1
Default value Effective execution policy
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
None
You cannot pipe input to this cmdlet.

# OUTPUTS
Microsoft.PowerShell.ExecutionPolicy
Get-ExecutionPolicy returns an object for each execution policy that it gets.

# NOTES

You cannot use Get-ExecutionPolicy to get particular execution policies set for a particular scope or to get the execution policy set by a Group Policy. Get-ExecutionPolicy only gets the effective execution policy that results from applying all precedence rules.

The execution policy is part of the security strategy of Windows PowerShell. It determines whether you can load configuration files (including your Windows PowerShell profile) and run scripts, and it determines which scripts, if any, must be digitally signed before they will run.

The effective execution policy is determined by the policies that you set by using Set-ExecutionPolicy and the "Turn on Script Execution" group policies for computers and users. The precedence order is Computer Group Policy > User Group Policy > Process (session) execution policy > User execution policy > Computer execution policy.

For more information about Windows PowerShell execution policy, including definitions of the Windows PowerShell policies, see about_Execution_Policies.

# EXAMPLE 1

C:\PS>get-executionpolicy

Restricted

# Description
-----------
This command gets the current execution policy for the shell.

# EXAMPLE 2

C:\PS>set-executionpolicy RemoteSigned; get-executionPolicy

RemoteSigned

# Description
-----------
These commands set a new user preference for the shell execution policy and then display the effective execution policy. The commands are separated by a semicolon (;). In this example, because there is no Group Policy setting, the user preference is the effective policy for the shell.

# EXAMPLE 3

C:\PS>get-executionpolicy -list

Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser AllSigned
LocalMachine RemoteSigned

C:\PS> get-executionpolicy
AllSigned

# Description
-----------
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.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=113315
Set-ExecutionPolicy
Get-AuthenticodeSignature
Set-AuthenticodeSignature
about_Execution_Policies
about_Signing

C:\Windows>powershell get-help Set-ExecutionPolicy -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows-10 / Windows-8.1 & 8 / Windows-7 & Vista / Windows Server 2008-2016
»»»» ColorConsole



 


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell





;-)









Download the Windows 7 Starter, Home (Basic Premium), Professional und Ultimate!

... facebook.de
0.233
Windows 10 Home oder Pro version?  / Wie kann ich die Sprache in Windows-10 ändern?  / How to enable the password prompt for screen saver in Windows 8.1 (disable, turn off, turn on)?  / Was für eine Seite ist 0.facebook.de?  / Warum kann ich in Win-7 als Admin nicht auf alle Dateien, bzw. Ordner zugreifen?  / Wie kann ich meine Telekom Sprach-Box einschalten, bzw. Ausschalten des Anrufbeantworters?  / How work the Paste HTML command in QuickTextPaste?  / Can I disable autoplay for DVD, CD, USB in Windows 7, how to?  / Wie formatiere ich in Windows-8 neue Festplatten, oder erstelle eine neue Partition?  / Was ist x64 und x86? Wo ist der Unterschied?  / Kann ich selbst die Windows-XP Datei Boot.ini bearbeiten und konfigurieren?  / Server-Manager bei Anmeldung nicht starten (Server 2012, 2008)?  /