Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Powershell.exe.config

451 views
Skip to first unread message

RichS

unread,
Mar 21, 2008, 11:43:01 AM3/21/08
to
As far as I am aware PowerShell doesn't work that way. I presume from your
post that the dlls contain .NET assemblies that you want to reference in
PowerShell. probably the easiest way make them accessible is to use

[void] [Reflection.Assembly]::LoadFile(.......)

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"Steve" wrote:

> Hi,
>
> I need to set the probing path for powershell (so that it can find the DLLs
> i need to use).
>
> I created a powershell.exe.config and placed it in
> C:\WINDOWS\system32\windowspowershell\v1.0.
>
> I drop powershell and restart it.
>
> Using fusion, with enabledlog turned on, it says that "no configuration file
> loaded" for powershell, in resolving a "Load"
>
> Why cant i get powershell to use its config file?
>
> Many thanks.

Oisin (x0n) Grehan [MVP]

unread,
Mar 21, 2008, 12:02:09 PM3/21/08
to
> > Many thanks.- Hide quoted text -
>
> - Show quoted text -

Actually powershell.exe.config is most definitely loaded by
powershell, it's a .net application like anything else. You can prove
this quite simply by dropping a powershell.exe.config file into the
v1.0 directory:

<configuration>
<appSettings>
<add key="foo" value="bar" />
</appSettings>
</configuration>

Then, fire up posh and read it back:

==
Windows PowerShell
Copyright (C) 2006 Microsoft Corporation. All rights reserved.

PowerTab version 0.99 Beta 2 PowerShell TabExpansion library
/\/\o\/\/ 2007 http://thePowerShellGuy.com
PowerTab Tabexpansion additions enabled : True
PS C:\Users\Oisin>
[System.Configuration.ConfigurationSettings]::AppSettings["foo"]
bar

et voila. Your problems lie elsewhere ;-)

Can you give us more technical detail and what, why and how you're
trying to do what it is you need to do? I have a decent amount of
experience with the CLR loader.

- Oisin

RichS

unread,
Mar 21, 2008, 1:48:01 PM3/21/08
to
Great - I'd not looked at it before so thanks for the update. One point on
putting files into the v1 folder - on Visat the UAC may kick in and either
block you creating the file or from editing it later

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk

Steve

unread,
Mar 20, 2008, 3:49:03 PM3/20/08
to

Oisin (x0n) Grehan [MVP]

unread,
Mar 26, 2008, 11:05:01 AM3/26/08
to

Hi Steve,

Can you please post your powershell.exe.config configuration here,
along with current behaviour and expected behaviour in as much detail
as possibe?

Thanks,

- Oisin

0 new messages