Powershell Parameters
Specifying correct type for password should be enough, try: Param ( [Parameter(Mandatory=$True)] [string]$FileLocation, [Parameter(Mandatory=$True)] [Security.SecureString]$password ) PowerShell will “mask” password (same as for read-host -asSecureString) and result type will be the one that other cmdlets may require. EDIT: After recent comments: solution, that gives both option to provide plain text password, or force user to … Read more