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 @@ -188,7 +188,19 @@ task MoveLiveMountNetworkAddress {
188188 }
189189 $output = Invoke-VMScript @splat - ErrorAction Stop
190190 $splat = @ {
191- ScriptText = ' (Get-NetAdapter| where {($_.MacAddress).ToLower() -eq "' + $TestInterfaceMAC + ' "} | Get-NetIPAddress -AddressFamily IPv4).IPAddress'
191+ ScriptText = ' function Elevate-Process {
192+ param ([string]$exe = $(Throw "Pleave provide the name and path of an executable"),[string]$arguments)
193+ $startinfo = new-object System.Diagnostics.ProcessStartInfo
194+ $startinfo.FileName = $exe
195+ $startinfo.Arguments = $arguments
196+ $startinfo.verb = "RunAs"
197+ $process = [System.Diagnostics.Process]::Start($startinfo)
198+ }
199+ function QueryIP {
200+ Get-NetAdapter| where {($_.MacAddress).ToLower() -eq "' + $TestInterfaceMAC + ' "}
201+ | Get-NetIPAddress -AddressFamily IPv4).IPAddress
202+ }
203+ Elevate-Process -Exe powershell.exe -Arguments "-noninteractive -command QueryIP > C:\rubrik.txt"'
192204 ScriptType = ' PowerShell'
193205 VM = $Config.virtualMachines [$i ].mountName
194206 GuestCredential = $GuestCredential
You can’t perform that action at this time.
0 commit comments