Hi - Non-experienced PWSH person here and in need of help.
Context: I have a Windows Server which has had PS7 installed in addition to the PS5.x which came by default. The server has constrained access to the IDN Tenant only and does not have CLI or access to Github. The PowerShell SDK was installed manually.
I will be calling in SDK cmdlets from a dedicated script, ‘MyPS7-SP-SDK.ps1’ which is called from and AfterModify script that is running correctly under PS5.x. The MyPS7-SP-SDK.ps1 runs the Import-Module PSSailPoint.x commands.
I have set the Client ID / Secret and BaseURL values in Environment variables and I can run the AfterCreate script from the PowerShell ISC which calls the MyPS7-SP-SDK.ps1 script which in turn makes the API calls to IDN successfully.
However, when the AfterCreate script is called from ISC by a Modify operation, the MyPS7-SP-SDK.ps1 script fails to make the API calls to IDN successfully. Using logging, I looks like it is not authenticating to IDN and therefore the Get-Accounts call is returning nothing.
What am I doing wrong? How do I get the AfterCreate script to call the MyPS7-SP-SDK.ps1 script in such a way that it is able to Authenticate to IDN (get the Token)?
Any pointers or suggestions you can offer will be very much appreciated.