2.6 KiB
Get-ProxmoxVMTemplate
Gets virtual machine templates.
Syntax
Get-ProxmoxVMTemplate
[-Name <String>]
[-UseRegex]
[<CommonParameters>]
Description
The Get-ProxmoxVMTemplate cmdlet retrieves virtual machine templates. You can retrieve all templates or a specific template by name.
Parameters
-Name
The name of the template to retrieve. Supports wildcards and regex when used with -UseRegex.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: True
-UseRegex
Use regular expressions for filtering.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
Outputs
PSProxmox.Models.ProxmoxVMTemplate
Notes
- This cmdlet does not require a connection to a Proxmox VE server as templates are stored locally.
- If the
-Nameparameter is specified and the template is not found, an error will be thrown. - The
-Nameparameter supports wildcards (e.g., "Ubuntu*") by default. - Use the
-UseRegexparameter with-Nameto filter using regular expressions (e.g., "^Ubuntu-[0-9]+\.[0-9]+$").
Examples
Example 1: Get all templates
$templates = Get-ProxmoxVMTemplate
This example gets all templates.
Example 2: Get a specific template by name
$template = Get-ProxmoxVMTemplate -Name "Ubuntu-Template"
This example gets the template named "Ubuntu-Template".
Example 3: Get templates by name using wildcards
$templates = Get-ProxmoxVMTemplate -Name "Ubuntu*"
This example gets all templates with names starting with "Ubuntu".
Example 4: Get templates by name using regex
$templates = Get-ProxmoxVMTemplate -Name "^Ubuntu-[0-9]+\\.[0-9]+$" -UseRegex
This example gets all templates with names matching the pattern "Ubuntu-" followed by a version number (e.g., "Ubuntu-20.04").