Skip to main content
Answer

create one liner for 2 step command

  • November 10, 2023
  • 1 reply
  • 108 views

Forum|alt.badge.img

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?

Best answer by AnthonyM

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

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!

1 reply

AnthonyM
  • Novice
  • Answer
  • November 13, 2023

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

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!