PowerShell App Launcher with Argument Input

PowerShell App Launcher with Argument Input

Model: GPT-4
Difficulty: Intermediate
Upvotes: 0
appsautomationITlauncherPowerShell

โ€” Prompt โ€”

Write a PowerShell script that prompts for a file path and launches [app] with that file as argument. Add validation and error handling for bad input.

Why It Works

Saves time for techs and advanced usersโ€”avoids manual drag-and-drop.

Example Output

App: Excel. Prompt: Enter .xlsx path. Test: File exists. If ok: Start-Process excel.exe file.xlsx. Else: Error message.