With PowerShell on Linux you’d never run dnf starting with Invoke-Expression. It’s completely unnecessary.
This feels like you either legitimately don’t know how it works so are assuming, or are making it more complicated on purpose to make bash look ‘better’.
I’m not saying PowerShell should be used on Linux over bash, but your example is not a good one.
With PowerShell on Linux you’d never run dnf starting with Invoke-Expression. It’s completely unnecessary.
This feels like you either legitimately don’t know how it works so are assuming, or are making it more complicated on purpose to make bash look ‘better’.
I’m not saying PowerShell should be used on Linux over bash, but your example is not a good one.