0

I have a static path: C:\Program Files\N-able Technologies\EndpointSetupInformation\

And then a GUID folder, which is different per machine: {10ba9c5f-8bc1-4094-c245-1e6a38d90090} for instance, and the GUID folder is the only folder in the directory.

And then the exe file: installer.exe

I need to run that installer.exe with powershell. How can I do this simply? Basically something like: C:\Program Files\N-able Technologies\EndpointSetupInformation\{*}\installer.exe

1 Answer 1

3

You can have the following which will allow you to assign the full path to a variable for use later.

$installer = (Get-ChildItem 'C:\Program Files\N-able Technologies\EndpointSetupInformation\*\installer.exe').FullName

This assumes that there is only one installer.exe file one folder deep.

You could drop the .FullName at the end and then use $installer.FullName instead, giving you access to all the other properties that the Get-ChildItem has, such as .BaseName or .DirectoryName

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.