-
Notifications
You must be signed in to change notification settings - Fork 2
Getting started
Stuart Malcolm edited this page Oct 7, 2021
·
2 revisions
This tutorial describes how to get started after installing powerSAS
PS> Connect-SAS -Local
<do stuff>
PS> Disconnect-SAS
If the -local flag is not specified, then a Remote connection is assumed, and the
default remote server (if none given in the command line - see next example) is
the SAS On-Demand EU server odaws01-euw1.oda.sas.com
PS> Connect-SAS -Credential alice
Password for user alice: ******
<do stuff>
PS> Disconnect-SAS
In this example we are connecting to our corporate SAS production server which has
and example address of `` and using the Get-Credentials
cmdlet to prompt user for
all credentials
PS> Connect-SAS -server sasprod.company.com -credential (Get-Credentials)
PowerShell credential request
Enter your credentials.
User: bob
Password for user stuart: ****
<do stuff>
PS> Disconnect-SAS
NOTE THIS IS NOT RECOMMENDED, but is supported 'just in case'..
If you need to supply the username and password in a script, then the PS ConvertTo-SecureString
can be used to encode the password:
PS> $password = ConvertTo-SecureString "P@ssw0rd" -AsPlainText -Force
PS> $Cred = New-Object System.Management.Automation.PSCredential ("carol", $password)
PS> Connect-SAS -server sas.company.com -credential $Cred
<do stuff>
PS> Disconnect-SAS
The Write-SAS
# send a single command to SAS
PS> "%put &syshostname;" | write-sas
1 %put &syshostname;
odaws01-euw1
- TODO