AutomoxAutomox

create one liner for 2 step command

mikesid
November 10, 2023 at 4:15 pm UTC
#Worklets

What is the best way to have automox execute two one line commands? the commands would be:

 

winget install Microsoft.DotNet.DesktopRuntime.7

winget install Microsoft.DotNet.AspNetCore.7

 

would i create a worklet with both remedaition and execution code to something like this:

winget install Microsoft.DotNet.DesktopRuntime.7 && winget install Microsoft.DotNet.AspNetCore.7

 

i dont know if the && works the same way in windows as it does linux?

This discussion is archived and closed to replies. Continue it in the Automox Community Slack.

Discuss on Slack

Replies (1)

AnthonyMNovember 13, 2023
#1

In PowerShell, if you wanted to include it all on one line you’d separate the statements with a semicolon:

powershell1 line
winget install Microsoft.DotNet.DesktopRuntime.7; winget install Microsoft.DotNet.AspNetCore.7

 

But regarding readability, we typically just use two lines for things like this.

 

It is worth noting, a feature request to install multiple Winget packages in a single line ( winget install DesktopRuntime.7 AspNetCore.8 ) is currently in testing!