From 4b6941cd3940f39c6c03139ebe41492594cce6a0 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 18 Aug 2022 14:01:02 -0500 Subject: [PATCH 1/2] Fix module specification hashtable docs --- .../5.1/Microsoft.PowerShell.Core/About/about_Requires.md | 8 ++++---- .../5.1/Microsoft.PowerShell.Core/About/about_Using.md | 8 ++++---- .../7.0/Microsoft.PowerShell.Core/About/about_Requires.md | 8 ++++---- .../7.0/Microsoft.PowerShell.Core/About/about_Using.md | 8 ++++---- .../7.2/Microsoft.PowerShell.Core/About/about_Requires.md | 8 ++++---- .../7.2/Microsoft.PowerShell.Core/About/about_Using.md | 8 ++++---- .../7.3/Microsoft.PowerShell.Core/About/about_Requires.md | 8 ++++---- .../7.3/Microsoft.PowerShell.Core/About/about_Using.md | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md index 3ec0f356d60f..4c36d32f0ac8 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md @@ -1,7 +1,7 @@ --- description: Prevents a script from running without the required elements. Locale: en-US -ms.date: 05/24/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Requires @@ -120,11 +120,11 @@ following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md index 2d9d17a5cf83..b0fd61ad1d8f 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md @@ -1,7 +1,7 @@ --- description: Allows you to indicate which namespaces are used in the session. Locale: en-US -ms.date: 01/19/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_using?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Using @@ -58,11 +58,11 @@ A module specification is a hash table that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md index 0aaba9fc520d..bb4204601812 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md @@ -1,7 +1,7 @@ --- description: Prevents a script from running without the required elements. Locale: en-US -ms.date: 05/24/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Requires @@ -120,11 +120,11 @@ following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md index ba3e772f1f47..e88be0855c4d 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md @@ -1,7 +1,7 @@ --- description: Allows you to indicate which namespaces are used in the session. Locale: en-US -ms.date: 01/19/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_using?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Using @@ -63,11 +63,11 @@ A module specification is a hash table that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md index d1e33c67672b..d6c007a35947 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md @@ -1,7 +1,7 @@ --- description: Prevents a script from running without the required elements. Locale: en-US -ms.date: 05/24/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Requires @@ -120,11 +120,11 @@ following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md index 2e8bf0c2fa25..3c3285ea4b3b 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md @@ -1,7 +1,7 @@ --- description: Allows you to indicate which namespaces are used in the session. Locale: en-US -ms.date: 01/19/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_using?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Using @@ -58,11 +58,11 @@ A module specification is a hash table that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md index 088f6bdb99ff..7fd562b23720 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md @@ -1,7 +1,7 @@ --- description: Prevents a script from running without the required elements. Locale: en-US -ms.date: 05/24/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_requires?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Requires @@ -120,11 +120,11 @@ following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md index 89b974c70d32..4cafaff46c96 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md @@ -1,7 +1,7 @@ --- description: Allows you to indicate which namespaces are used in the session. Locale: en-US -ms.date: 01/19/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_using?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: about Using @@ -58,11 +58,11 @@ A module specification is a hash table that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. + This cannot be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not From 51b4f23cd4d55bcd18643f1c9b0a8b8e8f299cb9 Mon Sep 17 00:00:00 2001 From: Michael Lombardi Date: Thu, 18 Aug 2022 14:59:51 -0500 Subject: [PATCH 2/2] (GH-9138) Update ModuleSpecification params This commit updates the parameter documentation for the cmdlets that have the ModuleSpecification type to use the updated and corrected language. --- .../About/about_Requires.md | 6 ++-- .../About/about_Using.md | 4 +-- .../Microsoft.PowerShell.Core/Get-Command.md | 24 ++++++++----- .../Microsoft.PowerShell.Core/Get-Module.md | 34 ++++++------------- .../Import-Module.md | 19 +++++++---- .../Remove-Module.md | 20 +++++++++-- .../Microsoft.PowerShell.Core/Save-Help.md | 29 ++++++++++------ .../Microsoft.PowerShell.Core/Update-Help.md | 25 ++++++++------ .../Export-PSSession.md | 29 ++++++++++------ .../Import-PSSession.md | 27 +++++++++------ .../About/about_Requires.md | 6 ++-- .../About/about_Using.md | 4 +-- .../Microsoft.PowerShell.Core/Get-Command.md | 24 ++++++++----- .../Microsoft.PowerShell.Core/Get-Module.md | 34 ++++++------------- .../Import-Module.md | 19 +++++++---- .../Remove-Module.md | 20 +++++++++-- .../Microsoft.PowerShell.Core/Save-Help.md | 29 ++++++++++------ .../Microsoft.PowerShell.Core/Update-Help.md | 25 ++++++++------ .../Export-PSSession.md | 29 ++++++++++------ .../Import-PSSession.md | 27 +++++++++------ .../About/about_Requires.md | 6 ++-- .../About/about_Using.md | 4 +-- .../Microsoft.PowerShell.Core/Get-Command.md | 24 ++++++++----- .../Microsoft.PowerShell.Core/Get-Module.md | 34 ++++++------------- .../Import-Module.md | 19 +++++++---- .../Remove-Module.md | 20 +++++++++-- .../Microsoft.PowerShell.Core/Save-Help.md | 29 ++++++++++------ .../Microsoft.PowerShell.Core/Update-Help.md | 25 ++++++++------ .../Export-PSSession.md | 29 ++++++++++------ .../Import-PSSession.md | 27 +++++++++------ .../About/about_Requires.md | 6 ++-- .../About/about_Using.md | 4 +-- .../Microsoft.PowerShell.Core/Get-Command.md | 24 ++++++++----- .../Microsoft.PowerShell.Core/Get-Module.md | 34 ++++++------------- .../Import-Module.md | 19 +++++++---- .../Remove-Module.md | 20 +++++++++-- .../Microsoft.PowerShell.Core/Save-Help.md | 29 ++++++++++------ .../Microsoft.PowerShell.Core/Update-Help.md | 25 ++++++++------ .../Export-PSSession.md | 29 ++++++++++------ .../Import-PSSession.md | 27 +++++++++------ 40 files changed, 520 insertions(+), 348 deletions(-) diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md index 4c36d32f0ac8..e6b795dba9c8 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Requires.md @@ -114,8 +114,8 @@ and an optional version number. If the required modules aren't in the current session, PowerShell imports them. If the modules can't be imported, PowerShell throws a terminating error. -For each module, type the module name (\) or a hash table. The value -can be a combination of strings and hash tables. The hash table has the +For each module, type the module name (\) or a hashtable. The value +can be a combination of strings and hashtables. The hashtable has the following keys. - `ModuleName` - **Required** Specifies the module name. @@ -124,7 +124,7 @@ following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md index b0fd61ad1d8f..26b7cb94e232 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Using.md @@ -54,7 +54,7 @@ statement. When `` is a name or module specification, PowerShell searches the **PSModulePath** for the specified module. -A module specification is a hash table that has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. @@ -62,7 +62,7 @@ A module specification is a hash table that has the following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md index 058dd2b264b8..7229137f6400 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Command.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Command @@ -376,15 +376,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects, -described in the **Remarks** section of [ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in one -of the following formats: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. diff --git a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md index b95d5a7f7864..98bef81da452 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Get-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 06/02/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-module?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Module @@ -461,37 +461,25 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -See the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#microsoft-powershell-commands-modulespecification-ctor(system-collections-hashtable)). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two -parameters are mutually exclusive. - -The value can be a combination of strings and hash tables. The hash table has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. -> [!NOTE] -> This parameter also accepts simpler forms of input: -> -> - A module name -> - A fully-qualified path to the module -> - A relative path to the module. When used in a script, the relative path is resolved to a -> fully-qualified path relative to the location of the script file. +You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md index 3daf2a3f87d6..911bc0560d1e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Import-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 05/05/2022 +ms.date: 08/18/2022 no-loc: [Import-Module, -Scope] online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/import-module?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 @@ -776,16 +776,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified name of the module as a hash table. The value can be a combination of -strings and hash tables. The hash table has the following keys. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md b/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md index f91419ef9767..0b12435282c3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Remove-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 09/28/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-module?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Module @@ -126,7 +126,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified names of modules to remove. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md index c629ed983e30..1e6067313ca3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Save-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 10/22/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/save-help?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Save-Help @@ -285,19 +285,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md index 8aaab9160db8..339c5350c0e7 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/5.1/Microsoft.PowerShell.Core/Update-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 08/10/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/update-help?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Update-Help @@ -344,20 +344,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -These modules are described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that's specified in the -format: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -or +A module specification is a hashtable that has the following keys. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` - -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md index 2ce3e9db2945..647d1469bf74 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/export-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-PSSession @@ -357,19 +357,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Import-PSSession.md b/reference/5.1/Microsoft.PowerShell.Utility/Import-PSSession.md index 198418fcf14b..b718aaa78b62 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Import-PSSession.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Import-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/import-pssession?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-PSSession @@ -486,18 +486,25 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects -(described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_) -in the PowerShell SDK. For example, the **FullyQualifiedModule** parameter accepts a module name -that is specified in the format: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` or -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}`. +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. ```yaml diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md index bb4204601812..4a36611f7240 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Requires.md @@ -114,8 +114,8 @@ and an optional version number. If the required modules aren't in the current session, PowerShell imports them. If the modules can't be imported, PowerShell throws a terminating error. -For each module, type the module name (\) or a hash table. The value -can be a combination of strings and hash tables. The hash table has the +For each module, type the module name (\) or a hashtable. The value +can be a combination of strings and hashtables. The hashtable has the following keys. - `ModuleName` - **Required** Specifies the module name. @@ -124,7 +124,7 @@ following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md index e88be0855c4d..2cf4c5e77aac 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.0/Microsoft.PowerShell.Core/About/about_Using.md @@ -59,7 +59,7 @@ statement. When `` is a name or module specification, PowerShell searches the **PSModulePath** for the specified module. -A module specification is a hash table that has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. @@ -67,7 +67,7 @@ A module specification is a hash table that has the following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.0/Microsoft.PowerShell.Core/Get-Command.md b/reference/7.0/Microsoft.PowerShell.Core/Get-Command.md index 1859015fcf58..b68a63c5951f 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Get-Command.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Command @@ -394,15 +394,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects, -described in the **Remarks** section of [ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in one -of the following formats: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. diff --git a/reference/7.0/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.0/Microsoft.PowerShell.Core/Get-Module.md index f14f4c4f6b88..3eda2625fa7d 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Get-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 06/02/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-module?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Module @@ -462,37 +462,25 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -See the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#microsoft-powershell-commands-modulespecification-ctor(system-collections-hashtable)). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two -parameters are mutually exclusive. - -The value can be a combination of strings and hash tables. The hash table has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. -> [!NOTE] -> This parameter also accepts simpler forms of input: -> -> - A module name -> - A fully-qualified path to the module -> - A relative path to the module. When used in a script, the relative path is resolved to a -> fully-qualified path relative to the location of the script file. +You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.0/Microsoft.PowerShell.Core/Import-Module.md b/reference/7.0/Microsoft.PowerShell.Core/Import-Module.md index e1f12bc944a6..c7e48989eccf 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Import-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 05/05/2022 +ms.date: 08/18/2022 no-loc: [Import-Module, -Scope] online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/import-module?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 @@ -795,16 +795,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified name of the module as a hash table. The value can be a combination of -strings and hash tables. The hash table has the following keys. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.0/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.0/Microsoft.PowerShell.Core/Remove-Module.md index d9b172eb2188..c64cd03b96c3 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Remove-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 09/28/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-module?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Module @@ -126,7 +126,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified names of modules to remove. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.0/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.0/Microsoft.PowerShell.Core/Save-Help.md index 33685df5e88e..758446de72b0 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Save-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 10/22/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/save-help?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Save-Help @@ -287,19 +287,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.0/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.0/Microsoft.PowerShell.Core/Update-Help.md index b43e3eb24b84..fdfd8f93d17b 100644 --- a/reference/7.0/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.0/Microsoft.PowerShell.Core/Update-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 08/10/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/update-help?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Update-Help @@ -303,20 +303,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -These modules are described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that's specified in the -format: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -or +A module specification is a hashtable that has the following keys. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` - -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.0/Microsoft.PowerShell.Utility/Export-PSSession.md index 9cfdf34d6201..caf2e811d02e 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/export-pssession?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-PSSession @@ -365,19 +365,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.0/Microsoft.PowerShell.Utility/Import-PSSession.md b/reference/7.0/Microsoft.PowerShell.Utility/Import-PSSession.md index 085e6474b806..e319e61efdf3 100644 --- a/reference/7.0/Microsoft.PowerShell.Utility/Import-PSSession.md +++ b/reference/7.0/Microsoft.PowerShell.Utility/Import-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/import-pssession?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-PSSession @@ -486,18 +486,25 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects -(described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_) -in the PowerShell SDK. For example, the **FullyQualifiedModule** parameter accepts a module name -that is specified in the format: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` or -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}`. +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. ```yaml diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md index d6c007a35947..de459984ccae 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Requires.md @@ -114,8 +114,8 @@ and an optional version number. If the required modules aren't in the current session, PowerShell imports them. If the modules can't be imported, PowerShell throws a terminating error. -For each module, type the module name (\) or a hash table. The value -can be a combination of strings and hash tables. The hash table has the +For each module, type the module name (\) or a hashtable. The value +can be a combination of strings and hashtables. The hashtable has the following keys. - `ModuleName` - **Required** Specifies the module name. @@ -124,7 +124,7 @@ following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md index 3c3285ea4b3b..eae7eff9c3a0 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.2/Microsoft.PowerShell.Core/About/about_Using.md @@ -54,7 +54,7 @@ statement. When `` is a name or module specification, PowerShell searches the **PSModulePath** for the specified module. -A module specification is a hash table that has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. @@ -62,7 +62,7 @@ A module specification is a hash table that has the following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.2/Microsoft.PowerShell.Core/Get-Command.md b/reference/7.2/Microsoft.PowerShell.Core/Get-Command.md index f733269c0f8f..25e4e0cd8470 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Get-Command.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Command @@ -412,15 +412,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects, -described in the **Remarks** section of [ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in one -of the following formats: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. diff --git a/reference/7.2/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.2/Microsoft.PowerShell.Core/Get-Module.md index 055426da1500..528c1141b872 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Get-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 06/02/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-module?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Module @@ -462,37 +462,25 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -See the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#microsoft-powershell-commands-modulespecification-ctor(system-collections-hashtable)). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two -parameters are mutually exclusive. - -The value can be a combination of strings and hash tables. The hash table has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. -> [!NOTE] -> This parameter also accepts simpler forms of input: -> -> - A module name -> - A fully-qualified path to the module -> - A relative path to the module. When used in a script, the relative path is resolved to a -> fully-qualified path relative to the location of the script file. +You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.2/Microsoft.PowerShell.Core/Import-Module.md b/reference/7.2/Microsoft.PowerShell.Core/Import-Module.md index a835eb2ca46c..d0784d58b57e 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Import-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 05/05/2022 +ms.date: 08/18/2022 no-loc: [Import-Module, -Scope] online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/import-module?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 @@ -795,16 +795,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified name of the module as a hash table. The value can be a combination of -strings and hash tables. The hash table has the following keys. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.2/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.2/Microsoft.PowerShell.Core/Remove-Module.md index 4f852bb4ef1c..e18b334e7cdc 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Remove-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 09/28/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-module?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Module @@ -126,7 +126,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified names of modules to remove. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.2/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.2/Microsoft.PowerShell.Core/Save-Help.md index bf6bfc72fa81..49bdfa96e7bc 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Save-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 10/22/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/save-help?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Save-Help @@ -287,19 +287,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.2/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.2/Microsoft.PowerShell.Core/Update-Help.md index 8a1a016be9fa..fdba4e0a3a4e 100644 --- a/reference/7.2/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.2/Microsoft.PowerShell.Core/Update-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 08/10/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/update-help?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Update-Help @@ -303,20 +303,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -These modules are described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that's specified in the -format: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -or +A module specification is a hashtable that has the following keys. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` - -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.2/Microsoft.PowerShell.Utility/Export-PSSession.md index cc788f6549f5..27a2034c1bc6 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/export-pssession?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-PSSession @@ -366,19 +366,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.2/Microsoft.PowerShell.Utility/Import-PSSession.md b/reference/7.2/Microsoft.PowerShell.Utility/Import-PSSession.md index 8b30b1636603..1b26692ce0f2 100644 --- a/reference/7.2/Microsoft.PowerShell.Utility/Import-PSSession.md +++ b/reference/7.2/Microsoft.PowerShell.Utility/Import-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/import-pssession?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-PSSession @@ -486,18 +486,25 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects -(described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_) -in the PowerShell SDK. For example, the **FullyQualifiedModule** parameter accepts a module name -that is specified in the format: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` or -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}`. +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. ```yaml diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md index 7fd562b23720..e517f4c4c906 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Requires.md @@ -114,8 +114,8 @@ and an optional version number. If the required modules aren't in the current session, PowerShell imports them. If the modules can't be imported, PowerShell throws a terminating error. -For each module, type the module name (\) or a hash table. The value -can be a combination of strings and hash tables. The hash table has the +For each module, type the module name (\) or a hashtable. The value +can be a combination of strings and hashtables. The hashtable has the following keys. - `ModuleName` - **Required** Specifies the module name. @@ -124,7 +124,7 @@ following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. > [!NOTE] > `RequiredVersion` was added in Windows PowerShell 5.0. diff --git a/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md b/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md index 4cafaff46c96..d848d39b2f61 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md +++ b/reference/7.3/Microsoft.PowerShell.Core/About/about_Using.md @@ -54,7 +54,7 @@ statement. When `` is a name or module specification, PowerShell searches the **PSModulePath** for the specified module. -A module specification is a hash table that has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. @@ -62,7 +62,7 @@ A module specification is a hash table that has the following keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. - `RequiredVersion` - Specifies an exact, required version of the module. - This cannot be used with the other Version keys. + This can't be used with the other Version keys. The `using module` statement imports classes from the root module (`ModuleToProcess`) of a script module or binary module. It does not diff --git a/reference/7.3/Microsoft.PowerShell.Core/Get-Command.md b/reference/7.3/Microsoft.PowerShell.Core/Get-Command.md index 327787ca7635..7ac034bb831b 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Get-Command.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Get-Command.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-command?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Command @@ -412,15 +412,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects, -described in the **Remarks** section of [ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor?view=powershellsdk-1.1.0#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in one -of the following formats: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. diff --git a/reference/7.3/Microsoft.PowerShell.Core/Get-Module.md b/reference/7.3/Microsoft.PowerShell.Core/Get-Module.md index b6cbc56ed1a2..4050d3f66977 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Get-Module.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Get-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 06/02/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/get-module?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Get-Module @@ -462,37 +462,25 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -See the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#microsoft-powershell-commands-modulespecification-ctor(system-collections-hashtable)). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two -parameters are mutually exclusive. - -The value can be a combination of strings and hash tables. The hash table has the following keys. +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. -> [!NOTE] -> This parameter also accepts simpler forms of input: -> -> - A module name -> - A fully-qualified path to the module -> - A relative path to the module. When used in a script, the relative path is resolved to a -> fully-qualified path relative to the location of the script file. +You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.3/Microsoft.PowerShell.Core/Import-Module.md b/reference/7.3/Microsoft.PowerShell.Core/Import-Module.md index f424741ee9de..aeb2ef5caf7a 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Import-Module.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Import-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 05/05/2022 +ms.date: 08/18/2022 no-loc: [Import-Module, -Scope] online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/import-module?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 @@ -795,16 +795,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified name of the module as a hash table. The value can be a combination of -strings and hash tables. The hash table has the following keys. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. - `ModuleName` - **Required** Specifies the module name. - `GUID` - **Optional** Specifies the GUID of the module. -- It's also **Required** to specify one of the three below keys. These keys - can't be used together. +- It's also **Required** to specify at least one of the three below keys. - `ModuleVersion` - Specifies a minimum acceptable version of the module. - - `RequiredVersion` - Specifies an exact, required version of the module. - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.3/Microsoft.PowerShell.Core/Remove-Module.md b/reference/7.3/Microsoft.PowerShell.Core/Remove-Module.md index b8606807ff62..5dda8845c302 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Remove-Module.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Remove-Module.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 09/28/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/remove-module?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Remove-Module @@ -126,7 +126,23 @@ Accept wildcard characters: False ### -FullyQualifiedName -Specifies the fully qualified names of modules to remove. +The value can be a module name, a full module specification, or a path to a module file. + +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. + +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. + +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.3/Microsoft.PowerShell.Core/Save-Help.md b/reference/7.3/Microsoft.PowerShell.Core/Save-Help.md index 60bb99de56db..2d34a0748d1f 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Save-Help.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Save-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 10/22/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/save-help?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Save-Help @@ -287,19 +287,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.3/Microsoft.PowerShell.Core/Update-Help.md b/reference/7.3/Microsoft.PowerShell.Core/Update-Help.md index ea69b7d4c6a3..7b97a4160fa6 100644 --- a/reference/7.3/Microsoft.PowerShell.Core/Update-Help.md +++ b/reference/7.3/Microsoft.PowerShell.Core/Update-Help.md @@ -2,7 +2,7 @@ external help file: System.Management.Automation.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Core -ms.date: 08/10/2022 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/update-help?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Update-Help @@ -298,20 +298,23 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. -These modules are described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that's specified in the -format: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -or +A module specification is a hashtable that has the following keys. -`@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}.` - -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Export-PSSession.md b/reference/7.3/Microsoft.PowerShell.Utility/Export-PSSession.md index f1f83581ad77..44d45a088f79 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Export-PSSession.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Export-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/export-pssession?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Export-PSSession @@ -366,19 +366,26 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects. See -the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_). +The value can be a module name, a full module specification, or a path to a module file. -For example, the **FullyQualifiedModule** parameter accepts a module name that is specified in -either of these formats: +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}` +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. You cannot specify the -**FullyQualifiedModule** parameter in the same command as a **Module** parameter. the two -parameters are mutually exclusive. +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** +parameter. the two parameters are mutually exclusive. ```yaml Type: Microsoft.PowerShell.Commands.ModuleSpecification[] diff --git a/reference/7.3/Microsoft.PowerShell.Utility/Import-PSSession.md b/reference/7.3/Microsoft.PowerShell.Utility/Import-PSSession.md index c7b0a2ed8cfd..2cb980c25c5b 100644 --- a/reference/7.3/Microsoft.PowerShell.Utility/Import-PSSession.md +++ b/reference/7.3/Microsoft.PowerShell.Utility/Import-PSSession.md @@ -2,7 +2,7 @@ external help file: Microsoft.PowerShell.Commands.Utility.dll-Help.xml Locale: en-US Module Name: Microsoft.PowerShell.Utility -ms.date: 04/05/2021 +ms.date: 08/18/2022 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/import-pssession?view=powershell-7.3&WT.mc_id=ps-gethelp schema: 2.0.0 title: Import-PSSession @@ -486,18 +486,25 @@ Accept wildcard characters: False ### -FullyQualifiedModule -Specifies modules with names that are specified in the form of **ModuleSpecification** objects -(described in the Remarks section of -[ModuleSpecification Constructor (Hashtable)](/dotnet/api/microsoft.powershell.commands.modulespecification.-ctor#Microsoft_PowerShell_Commands_ModuleSpecification__ctor_System_Collections_Hashtable_) -in the PowerShell SDK. For example, the **FullyQualifiedModule** parameter accepts a module name -that is specified in the format: +The value can be a module name, a full module specification, or a path to a module file. -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"}` or -- `@{ModuleName = "modulename"; ModuleVersion = "version_number"; Guid = "GUID"}`. +When the value is a path, the path can be fully qualified or relative. A relative path is resolved +relative to the script that contains the using statement. -**ModuleName** and **ModuleVersion** are required, but **Guid** is optional. +When the value is a name or module specification, PowerShell searches the **PSModulePath** for the +specified module. -You cannot specify the **FullyQualifiedModule** parameter in the same command as a **Module** +A module specification is a hashtable that has the following keys. + +- `ModuleName` - **Required** Specifies the module name. +- `GUID` - **Optional** Specifies the GUID of the module. +- It's also **Required** to specify at least one of the three below keys. + - `ModuleVersion` - Specifies a minimum acceptable version of the module. + - `MaximumVersion` - Specifies the maximum acceptable version of the module. + - `RequiredVersion` - Specifies an exact, required version of the module. This can't be used with + the other Version keys. + +You can't specify the **FullyQualifiedModule** parameter in the same command as a **Module** parameter. The two parameters are mutually exclusive. ```yaml