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

Update refs to Win2012 since it is out of support #10563

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Explains how to use the Run with PowerShell feature to run a script from a file system drive.
Locale: en-US
ms.date: 01/03/2018
ms.date: 10/23/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_run_with_powershell?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Run With PowerShell
Expand All @@ -11,27 +11,25 @@ title: about Run With PowerShell

## Short description

Explains how to use the "Run with PowerShell" feature to run a script from a
Explains how to use the **Run with PowerShell** feature to run a script from a
file system drive.

## Long description

Beginning in Windows PowerShell 3.0, you can use the "Run with PowerShell"
feature to run scripts from File Explorer in Windows 8 and Windows Server 2012
and from Windows Explorer in earlier versions of Windows.
Beginning in Windows PowerShell 3.0, you can use the **Run with PowerShell**
feature to run scripts from File Explorer. The **Run with PowerShell** feature
is designed to run scripts that don't have required parameters and don't return
output to the command prompt.

The "Run with PowerShell" feature is designed to run scripts that do not have
required parameters and do not return output to the command prompt.
When you use the **Run with PowerShell** feature, the Windows PowerShell
console window appears only briefly, if at all. You can't interact with it.

When you use the "Run with PowerShell" feature, the Windows PowerShell console
window appears only briefly, if at all. You cannot interact with it.
To use the **Run with PowerShell** feature:

To use the "Run with PowerShell" feature:
In File Explorer (or Windows Explorer), right-click the script filename and
then select **Run with PowerShell**.

In File Explorer (or Windows Explorer), right-click the script file name and
then select "Run with PowerShell".

The "Run with PowerShell" feature starts a Windows PowerShell session that has
The **Run with PowerShell** feature starts a Windows PowerShell session that has
an execution policy of Bypass, runs the script, and closes the session.

It runs a command that has the following format:
Expand All @@ -40,22 +38,28 @@ It runs a command that has the following format:
PowerShell.exe -File <FileName> -ExecutionPolicy Bypass
```

"Run with PowerShell" sets the Bypass execution policy only for the session
**Run with PowerShell** sets the Bypass execution policy only for the session
(the current instance of the PowerShell process) in which the script runs.
This feature does not change the execution policy for the computer or the
This feature doesn't change the execution policy for the computer or the
user.

The "Run with PowerShell" feature is affected only by the AllSigned execution
The **Run with PowerShell** feature is affected only by the AllSigned execution
policy. If the AllSigned execution policy is effective for the computer or the
user, "Run with PowerShell" runs only signed scripts. "Run with PowerShell" is
not affected by any other execution policy. For more information, see
[about_Execution_Policies](about_Execution_Policies.md).
user, **Run with PowerShell** runs only signed scripts. **Run with PowerShell**
is not affected by any other execution policy. For more information, see
[about_Execution_Policies][01].

Troubleshooting Note: Run with PowerShell command might prompt you to confirm
the execution policy change.
> [!NOTE]
> **Run with PowerShell** feature might prompt you to confirm the execution
> policy change.

## See also

- [about_Execution_Policies](about_Execution_Policies.md)
- [about_Group_Policy_Settings](about_Group_Policy_Settings.md)
- [about_Scripts](about_Scripts.md)
- [about_Execution_Policies][01]
- [about_Group_Policy_Settings][02]
- [about_Scripts][03]

<!-- link references -->
[01]: about_Execution_Policies.md
[02]: about_Group_Policy_Settings.md
[03]: about_Scripts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Explains how to sign scripts so that they comply with the PowerShell execution policies.
Locale: en-US
ms.date: 06/05/2023
ms.date: 10/23/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_signing?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Signing
Expand Down Expand Up @@ -140,9 +140,8 @@ topic.
## Create a self-signed certificate

To create a self-signed certificate, use the [New-SelfSignedCertificate][04]
cmdlet in the PKI module. This module is introduced in PowerShell 3.0 and is
included in Windows 8 and Windows Server 2012. For more information, see the
help topic for the `New-SelfSignedCertificate` cmdlet.
cmdlet in the PKI module. This module is introduced in PowerShell 3.0. For more
information, see the help topic for the `New-SelfSignedCertificate` cmdlet.

```powershell
$params = @{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,9 @@ Windows PowerShell ISE introduces two new features in Windows PowerShell 4.0.
Windows PowerShell ISE is installed, enabled, and ready to use in all
supported versions of Windows.

- In Windows 8.1, Windows 8, Windows Server 2012 R2, and Windows Server 2012,
on the Start screen, type PowerShell_ISE, and then click PowerShell_ISE or
- In the Start menu, type PowerShell_ISE, and then click PowerShell_ISE or
Windows PowerShell ISE.

- In Windows Server 2012 R2 and Windows Server 2012, in Server Manager, on the
Tools menu, click Windows PowerShell ISE.

- In earlier versions of Windows, click Start, All Programs, Accessories,
Windows PowerShell, and then click Windows PowerShell ISE.

- In a Windows PowerShell console, Cmd.exe, or the Run or Search box in
Windows, type "PowerShell_ise.exe". You can also use the command-line
parameters, including the NoProfile switch. For more information, see
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Describes new features that are included in Windows PowerShell 5.1.
Locale: en-US
ms.date: 01/17/2018
ms.date: 10/23/2023
online version: https://learn.microsoft.com/powershell/module/about_windows_powershell_5.1?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: about Windows Powershell 5.1
Expand Down Expand Up @@ -34,23 +34,21 @@ work in Windows PowerShell 5.1 without changes.
from the Pull Server and when using PowerShellGet cmdlets
- Responses to a number of user requests and issues

Windows PowerShell 5.1 is installed by default on Windows Server version 2016 and higher and Windows
client version 10 and higher.
Windows PowerShell 5.1 is installed by default on Windows Server version 2016
and higher and Windows client version 10 and higher.

To install Windows PowerShell 5.1 on Windows Server 2012 R2, Windows 8.1 Enterprise, or Windows 8.1
Pro, see [Install and Configure WMF 5.1](/powershell/scripting/wmf/setup/install-configure). Be sure
to read the download details, and meet all system requirements, before you install Windows
Management Framework 5.1.
To install Windows PowerShell 5.1 on older versions of Windows, see
[Install and Configure WMF 5.1][09]. Be sure to read the download details, and
meet all system requirements, before you install Windows Management Framework
5.1.

You can also read about changes to Windows PowerShell 5.1 in
[What's New in Windows PowerShell](/powershell/scripting/windows-powershell/whats-new/what-s-new-in-windows-powershell-50).

## New Scenarios and Features in WMF 5.1

> Note: This information is preliminary and subject to change.
[What's New in Windows PowerShell][08].

### PowerShell Editions
Starting with version 5.1, PowerShell is available in different editions which denote varying feature sets and platform compatibility.

Starting with version 5.1, PowerShell is available in different editions which
denote varying feature sets and platform compatibility.

- **Desktop Edition:** Built on .NET Framework and provides compatibility with
scripts and modules targeting versions of PowerShell running on full footprint
Expand All @@ -61,20 +59,19 @@ Starting with version 5.1, PowerShell is available in different editions which d

**Learn more about using PowerShell Editions**

- [Determine running edition of PowerShell using $PSVersionTable](/powershell/module/microsoft.powershell.core/about/about_automatic_variables)
- [Filter Get-Module results by CompatiblePSEditions using PSEdition parameter](/powershell/module/microsoft.powershell.core/get-module)
- [Prevent script execution unless run on a compatible edition of PowerShell](/powershell/gallery/concepts/script-psedition-support)
- [Declare a module's compatibility to specific PowerShell versions](/powershell/gallery/concepts/module-psedition-support)
- [Determine running edition of PowerShell using $PSVersionTable][04]
- [Filter Get-Module results by CompatiblePSEditions using PSEdition parameter][05]
- [Prevent script execution unless run on a compatible edition of PowerShell][03]
- [Declare a module's compatibility to specific PowerShell versions][02]

### Catalog Cmdlets

Two new cmdlets have been added in the
[Microsoft.PowerShell.Security](/previous-versions/windows/powershell-scripting/hh847877(v=wps.640))
module; these generate and validate Windows catalog files.
Two new cmdlets have been added in the [Microsoft.PowerShell.Security][10]
module. These cmdlets generate and validate Windows catalog files.

#### New-FileCatalog

New-FileCatalog creates a Windows catalog file for set of folders and files.
`New-FileCatalog` creates a Windows catalog file for set of folders and files.
This catalog file contains hashes for all files in specified paths. Users can
distribute the set of folders along with corresponding catalog file
representing those folders. This information is useful to validate whether any
Expand All @@ -86,103 +83,107 @@ New-FileCatalog [-CatalogFilePath] <string> [[-Path] <string[]>]
```

Catalog versions 1 and 2 are supported. Version 1 uses the SHA1 hashing
algorithm to create file hashes; version 2 uses SHA256. Catalog version 2 is
not supported on *Windows Server 2008 R2* or *Windows 7*. You should use
catalog version 2 on *Windows 8*, *Windows Server 2012*, and later operating
systems.
algorithm to create file hashes; version 2 uses SHA256. You should use catalog
version 2.

To verify the integrity of catalog file (Pester.cat in above example), sign it
using
[Set-AuthenticodeSignature](/powershell/module/microsoft.powershell.security/set-authenticodesignature)
cmdlet.
using [Set-AuthenticodeSignature][07] cmdlet.

#### Test-FileCatalog

Test-FileCatalog validates the catalog representing a set of folders.
`Test-FileCatalog` validates the catalog representing a set of folders.

```
Test-FileCatalog [-Detailed] [-FilesToSkip <String[]>]
[-CatalogFilePath] <String> [[-Path] <String[]>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

This cmdlet compares all the files hashes and their relative paths found in
*catalog* with ones on *disk*. If it detects any mismatch between file hashes
and paths it returns the status as *ValidationFailed*. Users can retrieve all
this information by using the *-Detailed* parameter. It also displays signing
status of catalog in *Signature* property which is equivalent to calling
[Get-AuthenticodeSignature](/powershell/module/microsoft.powershell.security/get-authenticodesignature)
cmdlet on the catalog file. Users can also skip any file during validation by
using the *-FilesToSkip* parameter.
This cmdlet compares all file hashes and their relative paths found in a
_catalog_ with files on _disk_. If it detects any mismatch between file hashes
and paths it returns the status as `ValidationFailed`. Users can retrieve all
this information using the **Detailed** parameter. It also displays signing
status of catalog in **Signature** property, which is equivalent to calling
[Get-AuthenticodeSignature][06] cmdlet on the catalog file. Users can also skip
any file during validation using the **FilesToSkip** parameter.

### Module Analysis Cache

Starting with WMF 5.1, PowerShell provides control over the file that is used
Starting with WMF 5.1, PowerShell provides control over the file that's used
to cache data about a module, such as the commands it exports.

By default, this cache is stored in the file
`${env:LOCALAPPDATA}\Microsoft\Windows\PowerShell\ModuleAnalysisCache`. The
cache is typically read at startup while searching for a command and is
written on a background thread sometime after a module is imported.
cache is typically read at startup while searching for a command and is written
on a background thread sometime after a module is imported.

To change the default location of the cache, set the
`$env:PSModuleAnalysisCachePath` environment variable before starting
PowerShell. Changes to this environment variable will only affect children
processes. The value should name a full path (including filename) that
PowerShell has permission to create and write files. To disable the file
cache, set this value to an invalid location, for example:
PowerShell. Changes to this environment variable only affect child processes.
The value should name a full path (including filename) that PowerShell has
permission to create and write files. To disable the file cache, set this value
to an invalid location, for example:

```powershell
$env:PSModuleAnalysisCachePath = 'nul'
```

This sets the path to an invalid device. If PowerShell can't write to the
path, no error is returned, but you can see error reporting by using a tracer:
This sets the path to an invalid device. If PowerShell can't write to the path,
no error is returned, but you can see error reporting using a tracer:

```powershell
Trace-Command -PSHost -Name Modules -Expression {
Import-Module Microsoft.PowerShell.Management -Force
}
```

When writing out the cache, PowerShell will check for modules that no longer
exist to avoid an unnecessarily large cache. Sometimes these checks are not
desirable, in which case you can turn them off by setting:
When writing out the cache, PowerShell checks for modules that no longer exist
to avoid an unnecessarily large cache. You can disable the checks using the
following setting:

```powershell
$env:PSDisableModuleAnalysisCacheCleanup = 1
```

Setting this environment variable will take effect immediately in the current
Setting this environment variable takes effect immediately in the current
process.

### Specifying module version

In WMF 5.1, `using module` behaves the same way as other module-related
constructions in PowerShell. Previously, you had no way to specify a
particular module version; if there were multiple versions present, this
resulted in an error.
constructions in PowerShell. Previously, you had no way to specify a particular
module version. If there were multiple versions present, this resulted in an
error.

In WMF 5.1:

* You can use [ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor).
This hash table has the same format as `Get-Module -FullyQualifiedName`.
- You can use [ModuleSpecification Constructor (Hashtable)][01]. This hash
table has the same format as `Get-Module -FullyQualifiedName`.

**Example:** `using module @{ModuleName = 'PSReadLine'; RequiredVersion = '1.1'}`

* If there are multiple versions of the module, PowerShell uses the **same
resolution logic** as `Import-Module` and doesn't return an error--the same
behavior as `Import-Module` and `Import-DscResource`.
- If there are multiple versions of the module, PowerShell uses the **same
resolution logic** as `Import-Module` and doesn't return an error.

### Improvements to Pester

In WMF 5.1, the version of Pester that ships with PowerShell has been updated
from 3.3.5 to 3.4.0, with the addition of GitHub [PR# 484](https://github.com/pester/Pester/pull/484),
which enables better behavior for Pester on Nano Server.

You can review the changes in versions 3.3.5 to 3.4.0 by inspecting the
[CHANGELOG](https://github.com/pester/Pester/blob/main/docs/CHANGELOG.md) in the GitHub repository.
from 3.3.5 to 3.4.0. You can review the changes in versions 3.3.5 to 3.4.0 by
inspecting the [CHANGELOG][11] in the GitHub repository.

## KEYWORDS

What's New in Windows PowerShell 5.1

<!-- link references -->
[01]: /dotnet/api/microsoft.powershell.commands.modulespecification.-ctor
[02]: /powershell/gallery/concepts/module-psedition-support
[03]: /powershell/gallery/concepts/script-psedition-support
[04]: /powershell/module/microsoft.powershell.core/about/about_automatic_variables
[05]: /powershell/module/microsoft.powershell.core/get-module
[06]: /powershell/module/microsoft.powershell.security/get-authenticodesignature
[07]: /powershell/module/microsoft.powershell.security/set-authenticodesignature
[08]: /powershell/scripting/windows-powershell/whats-new/what-s-new-in-windows-powershell-50
[09]: /powershell/scripting/wmf/setup/install-configure
[10]: /previous-versions/windows/powershell-scripting/hh847877(v=wps.640)
[11]: https://github.com/pester/Pester/blob/main/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ user interface. You can pipe control panel items from the `Get-ControlPanelItem`
computers that do not have **Control Panel** or **File Explorer**, `Show-ControlPanelItem` searches
only control panel items that can open without these components.

This cmdlet was introduced in Windows PowerShell 3.0 and works on Windows 8, Windows Server 2012,
and higher versions.
This cmdlet was introduced in Windows PowerShell 3.0.

## EXAMPLES

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Security.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Security
ms.date: 12/12/2022
ms.date: 10/23/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.security/new-filecatalog?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: New-FileCatalog
Expand All @@ -29,9 +29,7 @@ paths. Users can then distribute the catalog with their files so that users can
changes have been made to the folders since catalog creation time.

Catalog versions 1 and 2 are supported. Version 1 uses the (deprecated) SHA1 hashing algorithm to
create file hashes, and version 2 uses SHA256. Catalog version 2 is not supported on Windows Server
2008 R2 or Windows 7. You should use catalog version 2 on Windows 8, Windows Server 2012, and later
operating systems.
create file hashes, and version 2 uses SHA256.

## EXAMPLES

Expand Down
7 changes: 4 additions & 3 deletions reference/5.1/Microsoft.PowerShell.Security/Set-Acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
external help file: Microsoft.PowerShell.Security.dll-Help.xml
Locale: en-US
Module Name: Microsoft.PowerShell.Security
ms.date: 12/12/2022
ms.date: 10/23/2023
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1&WT.mc_id=ps-gethelp
schema: 2.0.0
title: Set-Acl
Expand Down Expand Up @@ -205,8 +205,9 @@ Accept wildcard characters: False
Establishes or changes the central access policy of the item.
Enter the CAP ID or friendly name of a central access policy on the computer.

Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set central access policies for users and groups.
For more information, see [Dynamic Access Control: Scenario Overview](/windows-server/identity/solution-guides/dynamic-access-control--scenario-overview).
Beginning in Windows Server 2012, administrators can use Active Directory and Group Policy to set
central access policies for users and groups. For more information, see
[Dynamic Access Control: Scenario Overview](/windows-server/identity/solution-guides/dynamic-access-control--scenario-overview).

This parameter was introduced in Windows PowerShell 3.0.

Expand Down
Loading