Solved

create one liner for 2 step command

  • 10 November 2023
  • 1 reply
  • 64 views

Badge

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?

icon

Best answer by AnthonyM-Automox 13 November 2023, 16:23

View original

1 reply

Userlevel 1

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!

Reply