post #1 of 1
Thread Starter 
How do I access a Static Property of a C# class, from a PowerShell Script? I have no problem accessing it dynamically doing this

relevant code in PowerShell
Code:
[System.Reflection.Assembly]::LoadFrom("D:\Program Files\Scripts\XBMC Remote Wrapper Class.dll")

$Server = New-Object XBMC_Remote_Wrapper_Class.xbmc("http://192.168.0.110:8080","media","media")

but I have a static bool variable that I want to be able to set from my powershell script and I can find anything that tells me how to do this.

declaration in the C# class
Code:
public static bool debugOn = false;

It's been a few years since I have worked with a high level languages, so I'm pretty rusty. any help is appreciated.

EDIT: I figured it out I needed to do this
Code:
[XBMC_Remote_Wrapper_Class.xbmc]::debugOn = 1

Edited by Col. Newman - 2/17/13 at 8:54am
Main Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 955BE Gigabyte MA790FXT-UD5P 2x PowerColor HD7850 2GB 16GB (4 x 4GB) CORSAIR Vengeance DDR3 1600 
Hard DriveOptical DriveOSMonitor
WDC WD1001FALS-00J7B1 LG DVD RW DL 16x Windows 7 Ulimate x64 SyncMaster 2693hm 
MonitorMonitorPowerCase
Asus VW226H Asus VW226H Antec TPQ-850 850W Antec 900 
Mouse
Razor Abyssus - mirror special editon 
  hide details  
Reply
Main Rig
(15 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II 955BE Gigabyte MA790FXT-UD5P 2x PowerColor HD7850 2GB 16GB (4 x 4GB) CORSAIR Vengeance DDR3 1600 
Hard DriveOptical DriveOSMonitor
WDC WD1001FALS-00J7B1 LG DVD RW DL 16x Windows 7 Ulimate x64 SyncMaster 2693hm 
MonitorMonitorPowerCase
Asus VW226H Asus VW226H Antec TPQ-850 850W Antec 900 
Mouse
Razor Abyssus - mirror special editon 
  hide details  
Reply