MScholtes / PSVirtualDesktop

VirtualDesktop is a Powershell module that provides commandlets to manage virtual desktops of Windows 10.
MIT License
294 stars 18 forks source link

Pin-Application $Var #17

Closed timhow38 closed 2 years ago

timhow38 commented 2 years ago

I'm writing a script to pin an app using a stored hwnd value. I can do this by entering the hwnd value however when using a $var I am unable to and I receive this error: image

image

PS Script image

Machine Info: Windows 10 image

Thanks in advance for your help, I'm most definitely over looking some simple :3

MScholtes commented 2 years ago

Hello @timhow38,

I can't reproduce your problem, I can pass variables as parameter.

Can the error have another cause? Do you perhaps have several processes running with the name "Zoom" and are catching one without a window (i.e. MainWindowHandle is $NULL which is not allowed).

Greetings

Markus

timhow38 commented 2 years ago

Hi @MScholtes, Thanks for the reply, I'm positive that there is no other proccess running named "Zoom" but you raise a good question about the if I'm pulling the MainWindowHandle, I'll take a look again, I might need to save the "$proZoom" variable as an array and split the values.

Thanks for the insight this is most likely and issue on my end :)