I agree with @Tom - it looks like you might not have successfully connected to the SAS Workspace, as maybe the LanguageService property is null and that's what is causing the exception.
You should be able to use the PowerShell ISE on your desktop to help debug your PowerShell script and see a bit of what's going on.
Chris
... View more