logicappsio / LogicAppConnectionAuth

PowerShell Script to get an authorization link and complete auth for an OAuth connector.
MIT License
44 stars 24 forks source link

Script doesn't work if called from another script #6

Open srieppo2 opened 5 years ago

srieppo2 commented 5 years ago

If I run the script from Powershell it works, but if I try to run it from another script I get this error:

The variable '$Scope' cannot be retrieved because it has not been set. At LogicAppConnectionAuth.ps1:13 char:113

Why?

srieppo2 commented 5 years ago

This seems to be caused by running the calling script in strict mode 3. What is the point of this $scope variable? It is not initialized before this line or accessed anywhere after that?

silmer commented 5 years ago

This seems to be caused by running the calling script in strict mode 3. What is the point of this $scope variable? It is not initialized before this line or accessed anywhere after that?

I had the same issue. I think it has to do with strict mode, so maybe try turning strict mode off just before calling the script?