AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

powershell cmdlet (delphi.net)

Ein Thema von Remko · begonnen am 29. Feb 2008 · letzter Beitrag vom 3. Mär 2008
 
Benutzerbild von Remko
Remko

Registriert seit: 10. Okt 2006
Ort: 's-Hertogenbosch, Die Niederlande
222 Beiträge
 
RAD-Studio 2010 Arc
 
#1

powershell cmdlet (delphi.net)

  Alt 29. Feb 2008, 19:21
I am trying to convert this sample code in C# (creates a mailbox in Exchange 2007) to Delphi.net (RAD Studio 2007).

I installed PowerShell and made a reference to the System.Management.Automation.dll. On this code:
Delphi-Quellcode:
uses
  ...
  system.IO,
  system.Collections.Generic,
  system.Management.Automation,
  system.Management.Automation.Host,
  system.Management.Automation.Runspaces;
  ...

var
  rc: RunspaceConfiguration;
  snapEx: PSSnapInException;
  info: PSSnapInInfo;
  myRunSpace: Runspace;
  pl: PipeLine;
  newMbx: Command;
begin
  snapEx := nil;
  rc := RunSpaceConfiguration.Create;
  info := rc.AddPSSnapIn('Microsoft.Exchange.Management.PowerShell.Admin', snapEx);
  MyRunSpace := RunspaceFactory.CreateRunspace(rc);
  MyRunSpace.Open;
  pl := MyRunSpace.CreatePipeline;
I get error [DCC Error] uMain.pas(41): E2003 Undeclared identifier: 'Create' on the line rc := RunSpaceConfiguration.Create;
According to MSDN the RunSpaceConfiguration class is abstract that might have something to do with it, but in all examples (VB and C#) it is used like this.

Maybe this is just .net being new to me... but any help/suggestions is welcome.
  Mit Zitat antworten Zitat
 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:12 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz