Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Commit

Permalink
feat: Add port subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
lisp719 committed Mar 11, 2021
1 parent 31d0930 commit 09778e5
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@ $config = @{
Name = "ubuntu-20.04"
Version = "202008.16.0"
}
Ports = 2800, 3000, 3035, 3333, 8000, 8080
Ports = (
2800,
3000,
3035,
3333,
4000,
4200,
5000,
5001,
6000,
8000,
8080,
8085,
8888,
9099
)
Cpus = 2
Memory = 1024 * 3
}
Expand Down Expand Up @@ -77,6 +92,11 @@ switch ($Args[0]) {
"modify" {
Modify
}
"port" {
foreach ($port in $config.Ports) {
VBoxManage modifyvm $config.VmName --natpf1 "tcp${port},tcp,,${port},,${port}"
}
}
"rm" {
VBoxManage controlvm $config.VmName poweroff
VBoxManage unregistervm $config.VmName --delete
Expand Down

0 comments on commit 09778e5

Please sign in to comment.