Using vault in PowerShell script securely

we would like to call Vault in Powershell scripts and get credentials to use in script. I am not sure how to handle the secret zero part securely without compromise. For example, if I use some kind of auth method to get initial vault token and then use it to read secrets, any one else who has access to the script can make minor changes to it and will be able to get access to secrets from vault. I wonder if anyone has a way to securely use vault in powershell or any other scripts which are in plaintext or if there is a way if some one make changes to the script (if the file hash changed) it would invalidate access to auth method. any help is very much appreciated.