Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added execution policy settings #3431

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions docs-conceptual/azps-13.0.0/install-azps-optimized.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,40 @@ PowerShell version 7.4.

## Prerequisites

Determine if the **PSResourceGet** PowerShell module is installed and install it if necessary. The
**PSResourceGet** module provides improved capabilities for installing PowerShell resources,
including Azure PowerShell modules. **PSResourceGet** is preinstalled with PowerShell version 7.4 or
higher and is also supported in Windows PowerShell 5.1.
1. On Windows systems, you must set the PowerShell execution policy to remote signed or less
restrictive

1. Determine if the **PSResourceGet** PowerShell module is installed.
- Check the PowerShell execution policy:

```powershell
Get-Module -Name Microsoft.PowerShell.PSResourceGet -ListAvailable
```
```powershell
Get-ExecutionPolicy -List
```

1. Install the **PSResourceGet** PowerShell module.
- Set the PowerShell execution policy to remote signed:

```powershell
Install-Module -Name Microsoft.PowerShell.PSResourceGet -Repository PSGallery
```
```powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

For more information about execution policies, see
[about_Execution_Policies][execution-policies].

1. Determine if the **PSResourceGet** PowerShell module is installed and install it if necessary.
The **PSResourceGet** module provides improved capabilities for installing PowerShell resources,
including Azure PowerShell modules. **PSResourceGet** is preinstalled with PowerShell version 7.4
or higher and is also supported in Windows PowerShell 5.1.

- Determine if the **PSResourceGet** PowerShell module is installed.

```powershell
Get-Module -Name Microsoft.PowerShell.PSResourceGet -ListAvailable
```

- Install the **PSResourceGet** PowerShell module.

```powershell
Install-Module -Name Microsoft.PowerShell.PSResourceGet -Repository PSGallery
```

## The Az PowerShell module

Expand Down Expand Up @@ -111,6 +129,7 @@ To learn more about managing your Azure resources with the **Az** PowerShell mod
[Get Started with Azure PowerShell][get-started-azps].

<!-- link references -->
[execution-policies]: /powershell/module/microsoft.powershell.core/about/about_execution_policies
[install-psresourceget]: /powershell/gallery/powershellget/install-powershellget#install-microsoftpowershellpsresourceget
[install-psresource]: /powershell/module/microsoft.powershell.psresourceget/install-psresource
[get-started-azps]: get-started-azureps.md