Skip to content

Commit fb641c8

Browse files
authored
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
1 parent db68f43 commit fb641c8

File tree

110 files changed

+1066
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1066
-790
lines changed

LICENSE.md

-42
This file was deleted.

LICENSE.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PowerCLI-Example-Scripts
2+
Copyright 2021 VMware, Inc.
3+
4+
BSD 2-Clause License
5+
6+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9+
10+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modules/Backup-VCSA/Backup-VCSA.psm1

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<#
2+
Copyright 2021 VMware, Inc.
3+
SPDX-License-Identifier: BSD-2-Clause
4+
#>
15
Function Backup-VCSAToFile {
26
<#
37
.NOTES

Modules/ContentLibrary/ContentLibrary.psm1

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
Function Get-ContentLibrary {
1+
<#
2+
Copyright 2021 VMware, Inc.
3+
SPDX-License-Identifier: BSD-2-Clause
4+
#>
5+
Function Get-ContentLibrary {
26
<#
37
.NOTES
48
===========================================================================

Modules/CrossvCentervmotion/XVM.psm1

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<#
2+
Copyright 2021 VMware, Inc.
3+
SPDX-License-Identifier: BSD-2-Clause
4+
#>
15
Function Get-XVCMStatus {
26
<#
37
.NOTES
@@ -12,7 +16,7 @@ Function Get-XVCMStatus {
1216
.EXAMPLE
1317
Get-XVCMStatus
1418
#>
15-
$Uri = "http://localhost:8080/api/status" #Updated for 2.0, Old: "http://localhost:8080/api/ping"
19+
$Uri = "http://localhost:8080/api/status" #Updated for 2.0, Old: "http://localhost:8080/api/ping"
1620

1721
$results = Invoke-WebRequest -Uri $Uri -Method GET -TimeoutSec 5
1822

Modules/DatastoreFunctions/DatastoreFunctions.psm1

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Function Get-HostViews {
4747
}
4848
write-progress -activity "Collecting ESXi Host Views" -completed
4949
$allHosts
50-
}
50+
}
5151
}
5252

5353
Function Get-DatastoreMountInfo {
@@ -74,7 +74,7 @@ Function Get-DatastoreMountInfo {
7474
Throw "No Datastores found.`nIs ""$Datastore"" a Datastore Object?"
7575
}
7676
$allDatastoreNAAs = foreach ($ds in $allDatastores) {$ds.ExtensionData.Info.vmfs.extent[0].diskname}
77-
77+
7878
#Build the array of custom Host Objects
7979
$allHosts = Get-HostViews -datastore $allDatastores
8080
$output = @()
@@ -89,9 +89,9 @@ Function Get-DatastoreMountInfo {
8989
$thisDatastore = $alldatastores | ? {$_.ExtensionData.Info.vmfs.extent[0].diskname -eq $device.canonicalName}
9090
$hostviewDSAttachState = ""
9191
if ($device.operationalState[0] -eq "ok") {
92-
$hostviewDSAttachState = "Attached"
92+
$hostviewDSAttachState = "Attached"
9393
} elseif ($device.operationalState[0] -eq "off") {
94-
$hostviewDSAttachState = "Detached"
94+
$hostviewDSAttachState = "Detached"
9595
} else {
9696
$hostviewDSAttachState = $device.operationalstate[0]
9797
}

Modules/Get-NICDetails/Get-NICDetails.psm1

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
function Get-NICDetails {
2-
<#
2+
<#
33
.NOTES
44
===========================================================================
55
Created by: Markus Kraus
66
Twitter: @VMarkus_K
77
Private Blog: mycloudrevolution.com
88
===========================================================================
9-
Changelog:
10-
2017.02 ver 1.0 Base Release
9+
Changelog:
10+
2017.02 ver 1.0 Base Release
1111
===========================================================================
12-
External Code Sources:
12+
External Code Sources:
1313
-
1414
===========================================================================
1515
Tested Against Environment:
@@ -35,11 +35,11 @@
3535
#>
3636

3737
[CmdletBinding()]
38-
param(
38+
param(
3939
[Parameter(Mandatory=$True, ValueFromPipeline=$False, Position=0)]
4040
[ValidateNotNullorEmpty()]
4141
[String] $Clustername
42-
42+
4343
)
4444

4545
Begin {
@@ -49,14 +49,14 @@ Begin {
4949
$Validate = $False
5050
thow "No Cluster '$myCluster' found!"
5151
}
52-
52+
5353
}
5454

5555
Process {
5656

5757
$MyView = @()
5858
if ($Validate -eq $True) {
59-
59+
6060
foreach ($myVMhost in ($myCluster | Get-VMHost)) {
6161

6262
$esxcli2 = Get-ESXCLI -VMHost $myVMhost -V2
@@ -85,7 +85,7 @@ Process {
8585
}
8686

8787
}
88-
88+
8989
$MyView
9090

9191
}

Modules/Get-NewAndRemovedVMs/Get-NewAndRemovedVMs.psm1

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
function Get-NewAndRemovedVMs {
2-
<#
2+
<#
33
.NOTES
44
===========================================================================
55
Created by: Markus Kraus
66
Twitter: @VMarkus_K
77
Private Blog: mycloudrevolution.com
88
===========================================================================
9-
Changelog:
10-
2016.12 ver 1.0 Base Release
9+
Changelog:
10+
2016.12 ver 1.0 Base Release
1111
===========================================================================
12-
External Code Sources:
12+
External Code Sources:
1313
https://github.com/alanrenouf/vCheck-vSphere
1414
===========================================================================
1515
Tested Against Environment:
@@ -22,10 +22,10 @@ function Get-NewAndRemovedVMs {
2222
===========================================================================
2323
2424
.DESCRIPTION
25-
This Function report newly created and deleted VMs by Cluster.
25+
This Function report newly created and deleted VMs by Cluster.
2626
2727
.Example
28-
Get-NewAndRemovedVMs -ClusterName Cluster* | ft -AutoSize
28+
Get-NewAndRemovedVMs -ClusterName Cluster* | ft -AutoSize
2929
3030
.Example
3131
Get-NewAndRemovedVMs -ClusterName Cluster01 -Days 90
@@ -51,7 +51,7 @@ param(
5151
)
5252
Begin {
5353
function Get-VIEventPlus {
54-
54+
5555
param(
5656
[VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl[]]$Entity,
5757
[string[]]$EventType,
@@ -117,7 +117,7 @@ Begin {
117117
{
118118
$events | % { $_.createdTime = $_.createdTime.ToLocalTime() }
119119
}
120-
120+
121121
$events
122122
}
123123
}

Modules/Get-VMmaxIOPS/Get-VMmaxIOPS.psm1

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
function Get-VMmaxIOPS {
2-
<#
2+
<#
33
.NOTES
44
===========================================================================
55
Created by: Markus Kraus
66
Twitter: @VMarkus_K
77
Private Blog: mycloudrevolution.com
88
===========================================================================
9-
Changelog:
10-
2016.10 ver 1.0 Base Release
9+
Changelog:
10+
2016.10 ver 1.0 Base Release
1111
2016.11 ver 1.1 Added vSphere 6.5 Support, New Counters, More Error Handling
1212
===========================================================================
13-
External Code Sources:
13+
External Code Sources:
1414
http://www.lucd.info/2011/04/22/get-the-maximum-iops/
1515
https://communities.vmware.com/thread/485386
1616
===========================================================================
@@ -24,7 +24,7 @@ function Get-VMmaxIOPS {
2424
===========================================================================
2525
2626
.DESCRIPTION
27-
This Function will Create a VM Disk IOPS Report
27+
This Function will Create a VM Disk IOPS Report
2828
2929
.Example
3030
Get-VM TST* | Get-VMmaxIOPS -Minutes 60 | FT -Autosize
@@ -34,17 +34,17 @@ function Get-VMmaxIOPS {
3434
Get-VMmaxIOPS -VMs $SampleVMs -Minutes 60
3535
3636
.PARAMETER VMs
37-
Specify the VMs
37+
Specify the VMs
3838
3939
.PARAMETER Minutes
40-
Specify the Minutes to report (10080 is one Week)
40+
Specify the Minutes to report (10080 is one Week)
4141
4242
#Requires PS -Version 4.0
4343
#Requires -Modules VMware.VimAutomation.Core, @{ModuleName="VMware.VimAutomation.Core";ModuleVersion="6.3.0.0"}
4444
#>
4545

4646
[CmdletBinding()]
47-
param(
47+
param(
4848
[Parameter(Mandatory=$true, ValueFromPipeline=$True, Position=0)]
4949
[ValidateNotNullorEmpty()]
5050
[VMware.VimAutomation.ViCore.Impl.V1.Inventory.InventoryItemImpl[]] $VMs,
@@ -55,7 +55,7 @@ param(
5555
Begin {
5656
# none
5757
}
58-
Process {
58+
Process {
5959
if ($_.PowerState -eq "PoweredOn") {
6060
#region: Global Definitions
6161
[int]$TimeRange = "-" + $Minutes
@@ -82,7 +82,7 @@ Process {
8282

8383
#region: Creating Reports
8484
Write-Verbose "$(Get-Date -Format G) Create Report..."
85-
$reportPerf = @()
85+
$reportPerf = @()
8686
$reportPerf = $stats | Group-Object -Property {$_.Entity.Name},Instance | %{
8787
New-Object PSObject -Property @{
8888
VM = $_.Values[0]
@@ -98,7 +98,7 @@ Process {
9898
}
9999
Write-Verbose "$(Get-Date -Format G) Create Report completed"
100100
#endregion
101-
101+
102102

103103
}
104104
Else {
@@ -108,7 +108,7 @@ Process {
108108
}
109109

110110
End {
111-
# none
111+
# none
112112
}
113113

114114
}

0 commit comments

Comments
 (0)