Welcome to Microsoft Q&A, thank you for posting your question here!
Interesting to know you would like to programmatically get temporary AWS credentials using Azure AD integrated with AWS SSO, which I can use to access the AWS account.
To programmatically get temporary AWS credentials from Azure AD integrated with AWS SSO using PowerShell, you can use the AWS PowerShell module.
You can use the following command to get temporary credentials:
$sts = Get-STSCallerIdentity
$roleArn = "arn:aws:iam::123456789012:role/RoleName"
$sessionName = "SessionName"
$sessionDuration = 3600
$roleSessionName = "RoleSessionName"
$credentials = $sts.Credentials.GetFederationToken($roleArn,$sessionName,$sessionDuration,$null,$null,$null,$null,$roleSessionName)
The above can be modified to suite your need. This will return temporary credentials that you can use to access AWS resources. You can then use these credentials to make API calls to AWS services.
For more information, you can read from the link below:
Kindly let us know if the above helps or you need more assistance.
Best Regards,
Sina