@Hyper-V
1 Topicstrange behavior when selecting multiple values in GridView
I was writing a script to export Hyper-V VM, the script is basically meant to be run from CLI or scheduled-tasks. but I like to make my script also able to be used interactively. In Screencast GIF above, if no VMs have been supplied through CLI, a GridView is shown with names of available VMs. Multiple values (VMs) can be selected in the GridView. The Code for displaying GridView and reading the selection is highlighted in screencast. If I start the script through Powershell-ISE start button (F5), then the script works as expected, if multiple values are selected, values are then stored as array. If the script starts through commandline, and multiple values are selected in GridView, all the selected values are stored as a string, which is not the desired behavior! Why is it so and how to resolve it to get the expected result? OS is Windows 10 Pro 22H21.9KViews0likes10Comments