I don't code in powershell but I have written small utilities to set the desktop work area. I am chiming in just in case you may be unaware that it is a Windows quirk that if the Taskbar is not locked, the work area reported by the system will be the same as the current screen resolution, at least for single monitor systems.
In other words, if you like to run with a disappearing taskbar, setting the work area will have no effect. I haven't heard anything about it being fixed in Windows 11 so I doubt it ever will be.
If you wish to try setting the work area to see the effect you are welcome to download my freeware SetWorkArea
Edit: Also this article may be of interest:https://docs.microso...nfo-work-incorrectly