SCVVM Command freezing in Forms
Posted: Fri Sep 21, 2018 4:06 am
Product, version and build: PowerShell Studio 2018, v5.5.154
32 or 64 bit version of product: 64bit
Operating system: Windows Server 2016 (1607)
32 or 64 bit OS: 64bit
PS Engine: V5 - 64bit elevated with STA mode
I'm building a bunch of tools to simplify adding the whole network shebang for new subnets in SCVMM.
The main problem seems to be the command Set-SCLogicalNetworkDefinition.
Running this as a regular script (PS ISE or PSS) works as expected and the Write-Host will be displayed.
When run from a PSS form project, it will add the Subnet/Vlan to the network definition, but then freeze instead of continuing to the next line of code. This happens both from inside the PSS and after compiling.
32 or 64 bit version of product: 64bit
Operating system: Windows Server 2016 (1607)
32 or 64 bit OS: 64bit
PS Engine: V5 - 64bit elevated with STA mode
I'm building a bunch of tools to simplify adding the whole network shebang for new subnets in SCVMM.
Code: Select all
$SCVMMServer = "fqdn.of.scvmm.server"
$LogicalNetwork = Get-SCLogicalNetwork -VMMServer $SCVMMServer -Name "INU-Datacenter_WORKNetwork"
$LogicalNetworkDefinition = Get-SCLogicalNetworkDefinition -VMMServer $SCVMMServer -LogicalNetwork $LogicalNetwork -Name "INTEGRATION"
$allSubnetVlans = $LogicalNetworkDefinition.SubnetVLans
$newSubnetVLAN = New-SCSubnetVLan -VMMServer $SCVMMServer -Subnet "172.10.10.0/24" -VLanID "400"
$allSubnetVlans += $newSubnetVLAN
Set-SCLogicalNetworkDefinition -VMMServer $SCVMMServer -LogicalNetworkDefinition $LogicalNetworkDefinition -SubnetVLan $allSubnetVlans # this freezes
Write-Host "this will never be reached in a form"
Running this as a regular script (PS ISE or PSS) works as expected and the Write-Host will be displayed.
When run from a PSS form project, it will add the Subnet/Vlan to the network definition, but then freeze instead of continuing to the next line of code. This happens both from inside the PSS and after compiling.