Salmanmkc/1 cleanup#2
Salmanmkc/1 cleanup#2salmanmkc wants to merge 5 commits intobobsira:user/bosira/remote-powershell-scriptfrom
Conversation
| $Version = $Version.TrimStart('v') | ||
| Write-Output "* Downloading and installing Containerd v$version at $InstallPath" | ||
| "Downloading and installing Containerd v$version at $InstallPath" >> logs | ||
| "{0} - Downloading and installing Containerd v$version at $InstallPath" -f (Get-Date) >> logs |
There was a problem hiding this comment.
The timestamp is a good addition. However, we do not need to redirect each message to a logger, since we can do this: Install-Containerd >> logs.txt. This way, the code will be much cleaner and we'll not need to remember to add >> logs to every log.
| $dirPath = "C:\Users\$env:USERNAME\VirtualBox VMs\$VMName" | ||
| & VBoxManage controlvm $VMName poweroff --type headless | ||
| & VBoxManage unregistervm $VMName --delete | ||
| } |
There was a problem hiding this comment.
Log message for success and if the plaform is not supported
There was a problem hiding this comment.
I'll add a validated set to this file too
| } | ||
| } | ||
| else { | ||
| Write-Warning "The $dirPath directory doesn't exist." |
| if ($VMName) { | ||
| try{ | ||
| if ($Platform -eq "Hyper-V") { | ||
| $dirPath = "C:\Users\$env:USERNAME\.minikube\machines\$VMName" |
There was a problem hiding this comment.
Split HyperV and Virtual box to seperate functions to make it easier to mange each of them
There was a problem hiding this comment.
yup, eventually will do, this is in draft state, not finished
| if($Platform -eq "Hyper-V"){ | ||
| # set the vm switch first | ||
| $Switch = Set-VmSwitch -SwitchName $SwitchName | ||
| $VM = @{ |
There was a problem hiding this comment.
Split HyperV and Virtual box to seperate functions to make it easier to mange each of them
There was a problem hiding this comment.
ya will do eventually, wanted to push code a bit earlier, will clean up eventually when finished with everything else on this PR
| # Add-VMDvdDrive -VMName $VMName -Path "$PSScriptRoot\auto-install.iso" -ControllerNumber 1 -ControllerLocation 1 | ||
| Start-VM -Name $VMName | Out-Null | ||
| if($Platform -eq "Hyper-V"){ | ||
| $VM = @{ |
There was a problem hiding this comment.
Split HyperV and Virtual box to seperate functions to make it easier to mange each of them
DRAFT state, but just creating it early.
Changes