This repository was archived by the owner on Dec 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,19 @@ task MoveLiveMountNetworkAddress {
191191 $output = Invoke-VMScript @splat - ErrorAction Stop
192192 Write-Verbose " Remote script output:`n $ ( $output.ScriptOutput ) " - Verbose
193193 $splat = @ {
194- ScriptText = ' (Get-NetAdapter| where {($_.MacAddress).ToLower() -eq "' + $TestInterfaceMAC + ' "} | Get-NetIPAddress -AddressFamily IPv4).IPAddress'
194+ ScriptText = ' function Elevate-Process {
195+ param ([string]$exe = $(Throw "Pleave provide the name and path of an executable"),[string]$arguments)
196+ $startinfo = new-object System.Diagnostics.ProcessStartInfo
197+ $startinfo.FileName = $exe
198+ $startinfo.Arguments = $arguments
199+ $startinfo.verb = "RunAs"
200+ $process = [System.Diagnostics.Process]::Start($startinfo)
201+ }
202+ function QueryIP {
203+ Get-NetAdapter| where {($_.MacAddress).ToLower() -eq "' + $TestInterfaceMAC + ' "}
204+ | Get-NetIPAddress -AddressFamily IPv4).IPAddress
205+ }
206+ Elevate-Process -Exe powershell.exe -Arguments "-noninteractive -command QueryIP > C:\rubrik.txt"'
195207 ScriptType = ' PowerShell'
196208 VM = $Config.virtualMachines [$i ].mountName
197209 GuestCredential = $GuestCredential
You can’t perform that action at this time.
0 commit comments