Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with Powershell
#1
Hi there,

may someone can tell me what I am doing wrong?

I start 32-BIT powershell and enter:

PS C:\Program Files (x86)\ASG-Remote Desktop 2016> [reflection.assembly]::loadFrom( 'C:\Program Files (x86)\ASG-Remoteesktop 2016\ASGRD-PSAPI.dll' ) | import-module
PS C:\Program Files (x86)\ASG-Remote Desktop 2016> Connect-RDEnvironment

Cmdlet Connect-RDEnvironment an der Befehlspipelineposition 1
Geben Sie Werte für die folgenden Parameter an:
Environment: BMsSQL
Connect-RDEnvironment : Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
In Zeile:1 Zeichen:1
+ Connect-RDEnvironment
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Smile [Connect-RDEnvironment], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,CloudAdminPSModule.CmdLetEnvironment+RDBaseItemChildsGetCo
   mmand

PS C:\Program Files (x86)\ASG-Remote Desktop 2016> Connect-RDEnvironment -Environment BMsSQL -PassThrough
Connect-RDEnvironment : Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
In Zeile:1 Zeichen:1
+ Connect-RDEnvironment -Environment BMsSQL -PassThrough
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Smile [Connect-RDEnvironment], NullReferenceException
    + FullyQualifiedErrorId : System.NullReferenceException,CloudAdminPSModule.CmdLetEnvironment+RDBaseItemChildsGetCo
   mmand


Regards
briloner
Reply
#2
We are currently working on this - if you use the shortcut for loading powershell api it is working, but I know we need a way to access it through some script commands...
Regards/Gruss
Oliver
Reply
#3
Thats right. I need to access by script code. The link is not usable at this time for me. 

Is there a change to get a DLL, to load it into a .NET Project to manage connections? 

I need to delete existing items and create new items (copy is also ok). 

Regards
Reply
#4
Here is a working example that should help you


$workingdir = "Program Files (x86)\ASG-Remote Desktop 2016\"

Set-Location $workingdir
[Environment]::CurrentDirectory = Get-Location -PSProvider FileSystem

$path = $workingdir + "ASGRD-PSAPI.dll"

Add-Type -path $path
[reflection.assembly]::LoadFrom($path) | Import-Module

Connect-RDEnvironment -Environment Test -PassThrough
Regards/Gruss
Oliver
Reply




Users browsing this thread: 1 Guest(s)