-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a295b0f
commit 559110f
Showing
10 changed files
with
190 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# | ||
# Generated by: Trevor Squillario <[email protected]> | ||
# | ||
# Generated on: 9/16/2021 | ||
# Generated on: 2/8/2022 | ||
# | ||
|
||
@{ | ||
|
@@ -12,7 +12,7 @@ | |
RootModule = 'DellOpenManage.psm1' | ||
|
||
# Version number of this module. | ||
ModuleVersion = '2.3.3' | ||
ModuleVersion = '2.3.4' | ||
|
||
# Supported PSEditions | ||
# CompatiblePSEditions = @() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using module ..\..\Classes\Template.psm1 | ||
function Remove-OMETemplate { | ||
<# | ||
Copyright (c) 2018 Dell EMC Corporation | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
#> | ||
|
||
<# | ||
.SYNOPSIS | ||
Remove template in OpenManage Enterprise | ||
.DESCRIPTION | ||
Remove a configuration or deployment template from OpenManage Enterprise | ||
.PARAMETER Template | ||
Object of type Template returned from Get-OMETemplate function | ||
.INPUTS | ||
[Template]Template | ||
.EXAMPLE | ||
"TestTemplate01" | Get-OMETemplate | Remove-OMETemplate | ||
#> | ||
|
||
[CmdletBinding()] | ||
param( | ||
[Parameter(Mandatory=$true, ValueFromPipeline)] | ||
[Template]$Template | ||
) | ||
|
||
Begin { | ||
if(!$SessionAuth.Token){ | ||
Write-Error "Please use Connect-OMEServer first" | ||
Break | ||
Return | ||
} | ||
} | ||
Process { | ||
Try { | ||
if ($SessionAuth.IgnoreCertificateWarning) { Set-CertPolicy } | ||
$BaseUri = "https://$($SessionAuth.Host)" | ||
$Type = "application/json" | ||
$Headers = @{} | ||
$Headers."X-Auth-Token" = $SessionAuth.Token | ||
|
||
$TemplateUrl = $BaseUri + "/api/TemplateService/Templates($($Template.Id))" | ||
|
||
Write-Verbose "Removing template $($Template.Id)..." | ||
$TemplateResponse = Invoke-WebRequest -Uri $TemplateUrl -Method Delete -ContentType $Type -Headers $Headers | ||
if ($TemplateResponse.StatusCode -eq 204) { | ||
Write-Verbose "Remove template successful..." | ||
} | ||
else { | ||
Write-Error "Remove template failed..." | ||
} | ||
} | ||
Catch { | ||
Resolve-Error $_ | ||
} | ||
} | ||
|
||
End {} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
external help file: DellOpenManage-help.xml | ||
Module Name: DellOpenManage | ||
online version: | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Remove-OMETemplate | ||
|
||
## SYNOPSIS | ||
Remove template in OpenManage Enterprise | ||
|
||
## SYNTAX | ||
|
||
``` | ||
Remove-OMETemplate [-Template] <Template> [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
Remove a configuration or deployment template from OpenManage Enterprise | ||
|
||
## EXAMPLES | ||
|
||
### EXAMPLE 1 | ||
``` | ||
Get-OMETemplate "TestTemplate01" | Remove-OMETemplate | ||
``` | ||
|
||
## PARAMETERS | ||
|
||
### -Template | ||
Object of type Template returned from Get-OMETemplate function | ||
|
||
```yaml | ||
Type: Template | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 1 | ||
Default value: None | ||
Accept pipeline input: True (ByValue) | ||
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](http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
### [Template]Template | ||
## OUTPUTS | ||
## NOTES | ||
## RELATED LINKS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
#Requires -Modules DellOpenManage | ||
|
||
Import-Module DellOpenManage | ||
|
||
. ".\Examples\ExampleCredentials.ps1" | ||
|
||
# Connect to OME | ||
$credentials = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $OMEUsername, $(ConvertTo-SecureString -Force -AsPlainText $OMEPassword) | ||
Connect-OMEServer -Name $OMEServer -Credentials $credentials -IgnoreCertificateWarning | ||
|
||
# Generate report and download to CSV file | ||
$ReportId = Get-OMEReport | Where-Object 'Name' -EQ "Warranty Report" | Select-Object -ExpandProperty Id | ||
Invoke-OMEReport -ReportId $ReportId | Export-Csv c:\Temp\report.csv -NoTypeInformation | ||
|
||
Disconnect-OMEServer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters