How can I get Credentials that I had defined in jenkins to my powershell script?
Jenkins credentials
You can use custom groovy to get the credential from jenkins and you can use that in your powershell code. Please refer this https://scriptcrunch.com/groovy-script-retrieve-jenkins-credentials/