PowerShell gurus

Soldato
Joined
28 Sep 2008
Posts
14,158
Location
Britain
Sup!

Got a script that installs an application. It needs to be OS agnostic, in as much as, it should work on both x64 and x86 platforms.

The script installs the app fine, but the next part of the script needs to go the application folder and run additional steps. Obviously, here, the path will either be:

PHP:
C:\Program Files

or

PHP:
C:\Program Files x86

Is there a way to programatically get Powershell to know which program files folder to use?

I'd like to avoid two scripts if possible :)

I'm assuming architecture variable or similar?
 
Last edited:
Soldato
OP
Joined
28 Sep 2008
Posts
14,158
Location
Britain
Ok, issue here, (with test path) is that we might have some sort of application or program scripted during deployment which creates a "Program Files" folder (even on an x64 machine). If that happened, then this Powershell script would run without error (but the installation would actually fail).

I guess I need to look down the WMI route?
 
Back
Top Bottom