From 9aadadb3b6552bf9171495139bc964342f25fce7 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Thu, 18 Aug 2022 16:11:06 -0500 Subject: [PATCH] Fix RequireModules description & add Find example --- help/Find-PSResource.md | 26 ++++++++++++++++++++++++++ help/New-PSScriptFileInfo.md | 19 +++++++++---------- help/Update-ModuleManifest.md | 13 +++++++------ help/Update-PSScriptFileInfo.md | 25 ++++++++++++++++--------- 4 files changed, 58 insertions(+), 25 deletions(-) diff --git a/help/Find-PSResource.md b/help/Find-PSResource.md index 67db70601..96d322ff9 100644 --- a/help/Find-PSResource.md +++ b/help/Find-PSResource.md @@ -172,6 +172,32 @@ Computer_RenameComputerInDomain_Config 1.0.0.0 PSGallerySc Computer_RenameComputerInWorkgroup_Config 1.0.0.0 PSGalleryScripts This example will set the machin… ``` +### Example 8 + +This example shows how to find modules by a tag. The `CrescendoBuilt` value is a tag that is +automatically added to modules created using the **Microsoft.PowerShell.Crescendo** module. + +```powershell +Find-PSResource -Tag CrescendoBuilt +``` + +```Output +Name Version Prerelease Repository Description +---- ------- ---------- ---------- ----------- +Foil 0.1.0.0 PSGallery A PowerShell Crescendo wrapper for Chocolatey +Cobalt 0.3.1.0 PSGallery A PowerShell Crescendo wrapper for WinGet +SysInternals 1.1.0.0 PSGallery PowerShell cmdlets for SysInternal tools +Croze 0.0.4.0 PSGallery A PowerShell Crescendo wrapper for Homebrew +AptPackage 0.0.2.0 PSGallery PowerShell Crescendo-generated Module to query APT-Package Information +RoboCopy 1.0.1.0 PSGallery PowerShell cmdlet for the official RoboCopy.exe +TShark 1.0.2.0 PSGallery PowerShell cmdlet for tshark.exe +Image2Text 1.0.2.0 PSGallery PowerShell Images into ASCII art +SpeedTestCLI 1.0.0.0 PSGallery PowerShell cmdlets speedtest-cli +SpeedTest-CLI 1.0.0.0 PSGallery PowerShell cmdlets for Internet Speed Test +Quser.Crescendo 0.1.1.0 PSGallery This module displays session information of users logged onto a local or… +Takeown 1.0.2.0 PSGallery Crescendo Powershell wrapper of takeown.exe +``` + ## PARAMETERS ### -CommandName diff --git a/help/New-PSScriptFileInfo.md b/help/New-PSScriptFileInfo.md index d21f2db2c..13ce8181e 100644 --- a/help/New-PSScriptFileInfo.md +++ b/help/New-PSScriptFileInfo.md @@ -89,10 +89,8 @@ This is a test script. ### Example 2: Creating a script with required modules -This example runs the cmdlet with additional parameters, including **RequiredModules**. The -**RequiredModules** parameter describes modules required by the script. The parameter takes an array -of hashtables. The **ModuleName** key in the hashtable is required. You can also include -**ModuleVersion**, **RequiredVersion**, **MaximumVersion**, or **MinimumVersion** keys. +This example runs the cmdlet with additional parameters, including **RequiredModules**. +**RequiredModules** is an array of module specifications. ```powershell $parameters = @{ @@ -389,12 +387,13 @@ Accept wildcard characters: False The parameter takes an array of module specification hashtables. 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. -- One of these three version key is Required. These keys can't be used together. - - **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. +- `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: System.Collections.Hashtable[] diff --git a/help/Update-ModuleManifest.md b/help/Update-ModuleManifest.md index fa92c8339..ffbf4b297 100644 --- a/help/Update-ModuleManifest.md +++ b/help/Update-ModuleManifest.md @@ -650,12 +650,13 @@ global session state, PowerShell imports them. If the required modules aren't av The value can be an array containing module names or module specifications. 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. -- One of these three version key is Required. These keys can't be used together. - - **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. +- `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: System.Object[] diff --git a/help/Update-PSScriptFileInfo.md b/help/Update-PSScriptFileInfo.md index e2ea6848c..f3be83ae4 100644 --- a/help/Update-PSScriptFileInfo.md +++ b/help/Update-PSScriptFileInfo.md @@ -38,9 +38,15 @@ changes the **Version**' to `2.0.0.0`. The `Get-Content` cmdlet shows the update script. ```powershell -New-PSScriptFileInfo -FilePath "C:\Users\johndoe\MyScripts\test_script.ps1" -Version "1.0.0.0" -Description "this is a test script" -Update-PSScriptFileInfo -FilePath "C:\Users\johndoe\MyScripts\test_script.ps1" -Version "2.0.0.0" -Get-Content "C:\Users\johndoe\MyScripts\test_script.ps1" +$parameters = @{ + FilePath = "C:\Users\johndoe\MyScripts\test_script.ps1" + Version = "1.0.0.0" + Description = "this is a test script" +} +New-PSScriptFileInfo @parameters +$parameters.Version = "2.0.0.0" +Update-PSScriptFileInfo @parameters +Get-Content $parameters.FilePath ``` ```Output @@ -318,12 +324,13 @@ Accept wildcard characters: False The parameter takes an array of module specification hashtables. 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. -- One of these three version key is Required. These keys can't be used together. - - **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. +- `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: System.Collections.Hashtable[]