Skip to content

Commit 4b450c7

Browse files
authored
Merge pull request #762 from rubrikinc/mpreston-issue756
Issue 756 - Fixed New-RubrikHyperVVMMount documentation
2 parents 8a171ba + ea3c47a commit 4b450c7

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2525

2626
### Fixed
2727

28+
* Fixed documentation for `New-RubrikHyperVVMMount` resolving [Issue 756](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/756)
2829
* Fixed documentation for `Sync-RubrikTag`, resolving [Issue 757](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/757)
2930
* Updated API endpoints to `v1` for `Get-RubrikHostVolume`, `New-RubrikSnapshot` (VolumeGroup endpoint) & `Protect-RubrikVolumeGroup` cmdlets, fixing [Issue 747](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/747)
3031
* Fixed bug in `Submit-Request` which causes several issues [Issue 751](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/751) & [Issue 752](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/752)

Rubrik/Public/New-RubrikHyperVVMMount.ps1

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
#Requires -Version 3
22
function New-RubrikHyperVVMMount
33
{
4-
<#
4+
<#
55
.SYNOPSIS
66
Create a new Live Mount from a protected Hyper V VM
7-
7+
88
.DESCRIPTION
99
The New-RubrikHyperVVMMount cmdlet is used to create a Live Mount (clone) of a protected HyperV VM and run it in an existing HyperV environment.
10-
10+
1111
.NOTES
1212
Written by Mike Preston for community usage
1313
Twitter: @mwpreston
1414
GitHub: mwpreston
15-
15+
1616
.LINK
1717
https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/new-rubrikhypervvmmount
1818
1919
.EXAMPLE
2020
New-RubrikHyperVVMMount -id '11111111-2222-3333-4444-555555555555'
2121
This will create a new mount based on snapshot id "11111111-2222-3333-4444-555555555555"
2222
The original virtual machine's name will be used along with a date and index number suffix
23-
The virtual machine will NOT be powered on upon completion of the mount operation
24-
23+
The virtual machine will be powered on upon completion of the mount operation
24+
2525
.EXAMPLE
26-
New-RubrikHyperVVMMount -id '11111111-2222-3333-4444-555555555555' -MountName 'Mount1' -PowerOn -RemoveNetworkDevices
26+
New-RubrikHyperVVMMount -id '11111111-2222-3333-4444-555555555555' -MountName 'Mount1' -PowerOn:$false -RemoveNetworkDevices
2727
This will create a new mount based on snapshot id "11111111-2222-3333-4444-555555555555" and name the mounted virtual machine "Mount1"
28-
The virtual machine will be powered on upon completion of the mount operation but without any virtual network adapters
28+
The virtual machine will NOT be powered on upon completion of the mount operation but without any virtual network adapters
2929
3030
.EXAMPLE
31-
Get-RubrikHyperVVM 'Server1' | Get-RubrikSnapshot -Date '03/01/2017 01:00' | New-RubrikHyperVVMMount -MountName 'Mount1' -DisableNetwork
31+
Get-RubrikHyperVVM 'Server1' | Get-RubrikSnapshot -Date '03/01/2017 01:00' | New-RubrikHyperVVMMount -MountName 'Mount1' -DisableNetwork -PowerOn
3232
This will create a new mount based on the closet snapshot found on March 1st, 2017 @ 01:00 AM and name the mounted virtual machine "Mount1"
33-
The virtual machine will NOT be powered on upon completion of the mount operation
33+
The virtual machine will be powered on upon completion of the mount operation
3434
3535
#>
3636

@@ -39,16 +39,16 @@ function New-RubrikHyperVVMMount
3939
# Rubrik id of the snapshot
4040
[Parameter(Mandatory = $true,ValueFromPipelineByPropertyName = $true)]
4141
[String]$id,
42-
# ID of host for the mount to use
42+
# ID of host for the mount to use
4343
[String]$HostID,
44-
# Name of the mounted VM
44+
# Name of the mounted VM
4545
[Alias('vmName')]
4646
[String]$MountName,
47-
# Whether the network should be disabled on mount.This should be set true to avoid ip conflict in case of static IPs.
47+
# Whether the network should be disabled on mount.This should be set true to avoid ip conflict in case of static IPs.
4848
[Switch]$DisableNetwork,
4949
# Whether the network devices should be removed on mount.
5050
[Switch]$RemoveNetworkDevices,
51-
# Whether the VM should be powered on after mount.
51+
# Whether the VM should be powered on after mount. Without this parameter the VM defaults to be powered on. To ensure it isn't, specify -PoweredOn:$false
5252
[Switch]$PowerOn,
5353
# Rubrik server IP or FQDN
5454
[String]$Server = $global:RubrikConnection.server,
@@ -60,28 +60,28 @@ function New-RubrikHyperVVMMount
6060

6161
# The Begin section is used to perform one-time loads of data necessary to carry out the function's purpose
6262
# If a command needs to be run with each iteration or pipeline input, place it in the Process section
63-
63+
6464
# Check to ensure that a session to the Rubrik cluster exists and load the needed header data for authentication
6565
Test-RubrikConnection
66-
66+
6767
# API data references the name of the function
6868
# For convenience, that name is saved here to $function
6969
$function = $MyInvocation.MyCommand.Name
70-
70+
7171
# Retrieve all of the URI, method, body, query, result, filter, and success details for the API endpoint
7272
Write-Verbose -Message "Gather API Data for $function"
7373
$resources = Get-RubrikAPIData -endpoint $function
7474
Write-Verbose -Message "Load API data for $($resources.Function)"
7575
Write-Verbose -Message "Description: $($resources.Description)"
76-
76+
7777
}
7878

7979
Process {
80-
# If the switch parameter was not explicitly specified remove from body params
80+
# If the switch parameter was not explicitly specified remove from body params
8181
if(-not $PSBoundParameters.ContainsKey('DisableNetwork')) { $Resources.Body.Remove('disableNetwork') }
8282
if(-not $PSBoundParameters.ContainsKey('RemoveNetworkDevices')) { $Resources.Body.Remove('removeNetworkDevices') }
8383
if(-not $PSBoundParameters.ContainsKey('PowerOn')) { $Resources.Body.Remove('powerOn') }
84-
84+
8585
$uri = New-URIString -server $Server -endpoint ($resources.URI) -id $id
8686
$uri = Test-QueryParam -querykeys ($resources.Query.Keys) -parameters ((Get-Command $function).Parameters.Values) -uri $uri
8787
$body = New-BodyString -bodykeys ($resources.Body.Keys) -parameters ((Get-Command $function).Parameters.Values)

0 commit comments

Comments
 (0)