Skip to content

Fix RequireModules description & add Find example #769

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions help/Find-PSResource.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions help/New-PSScriptFileInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @{
Expand Down Expand Up @@ -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[]
Expand Down
13 changes: 7 additions & 6 deletions help/Update-ModuleManifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
25 changes: 16 additions & 9 deletions help/Update-PSScriptFileInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ changes the **Version**' to `2.0.0.0`. The `Get-Content` cmdlet shows the update
script.

```powershell
New-PSScriptFileInfo -Path "C:\Users\johndoe\MyScripts\test_script.ps1" -Version "1.0.0.0" -Description "this is a test script"
Update-PSScriptFileInfo -Path "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
Expand Down Expand Up @@ -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[]
Expand Down