User credentials object in PowerShell with the TridionModules and core service
$username = 'username'
$password = 'password' | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential($username, $password)
Set-TridionCoreServiceSettings -Credential $credential -Hostname "localhost" -Version Web-8.5 -Persist
Get-TridionUser