I want to use Add-RdsAccount in a function that's called by other scripts. But for the life of me, I cannot make work. The "Add-RdsAccount" call works and successfully authenticates, but *only* for the local scope. I cannot get that authentication to persist within a script or globally. Every single time I want to call a new function to perform some task with WVD, I have to call "Add-RdsAccount" directly from that function.
I've never had this problem before. I can authenticate to Azure, for example, and have that authentication persist script-wide or globally. There's something peculiar about Micorsoft.RDInfra.Powershell that doesn't allow "Add-RdsAccount" to persist outside a local scope.
Has anyone else come across this and found a solution?