License PowerCLI-Examples-Scripts repository under BSD-2 Clause (#462)
As part of the VMware open source program, we have to update this repository with the correct license and copyright information. We add the BSD-2 Clause License for this repository. We mark all source code provided by VMware with the Copyright notice under BSD-2 Clause license. * Update repository license to BSD 2-Clause License * Update Copyright
This commit is contained in:
@@ -1,4 +1,13 @@
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
<#
|
||||
Copyright 2017-2021 VMware, Inc.
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
#>
|
||||
<#
|
||||
Copyright 2021 VMware, Inc.
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
#>
|
||||
|
||||
# SRM Helper Methods - https://github.com/benmeadowcroft/SRM-Cmdlets
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
@@ -48,7 +57,7 @@ Function Get-ProtectionGroup {
|
||||
$pgi = $pg.GetInfo()
|
||||
$selected = (-not $Name -or ($Name -eq $pgi.Name)) -and (-not $Type -or ($Type -eq $pgi.Type))
|
||||
if ($selected) {
|
||||
Add-Member -InputObject $pg -MemberType NoteProperty -Name "Name" -Value $pgi.Name
|
||||
Add-Member -InputObject $pg -MemberType NoteProperty -Name "Name" -Value $pgi.Name
|
||||
$pg
|
||||
}
|
||||
}
|
||||
@@ -95,7 +104,7 @@ Function Get-ProtectedVM {
|
||||
try {
|
||||
$_.Vm.UpdateViewData()
|
||||
} catch {
|
||||
Write-Error $_
|
||||
Write-Error $_
|
||||
} finally {
|
||||
$_
|
||||
}
|
||||
@@ -359,7 +368,7 @@ Function New-ProtectionGroup {
|
||||
if ($pscmdlet.ShouldProcess($Name, "New")) {
|
||||
$task = $api.Protection.CreateHbrProtectionGroup($Folder.MoRef, $Name, $Description, $moRefs)
|
||||
}
|
||||
|
||||
|
||||
} elseif ($ArrayReplication) {
|
||||
#create list of managed object references from VM and/or VM view arrays
|
||||
$moRefs = @()
|
||||
@@ -373,7 +382,7 @@ Function New-ProtectionGroup {
|
||||
if ($pscmdlet.ShouldProcess($Name, "New")) {
|
||||
$task = $api.Protection.CreateAbrProtectionGroup($Folder.MoRef, $Name, $Description, $moRefs)
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
throw "Undetermined protection group type"
|
||||
}
|
||||
@@ -386,7 +395,7 @@ Function New-ProtectionGroup {
|
||||
if ($pg) {
|
||||
$unProtectedVMs = Get-UnProtectedVM -ProtectionGroup $pg
|
||||
$unProtectedVMs | Protect-VM -ProtectionGroup $pg
|
||||
}
|
||||
}
|
||||
|
||||
return $pg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user