You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe many of our scripts and YML use custom variables like OSVmImage to detect operating system. However, I think it might be better to use the built-in variable Agent.OS instead.
We can also use $IsWindows, $IsLinux, etc. in PowerShell but I want to make sure that we get the "marketing" version of the platform, e.g. Windows Server 2022 vs. Windows_NT
We were using the OS vm image as a way to discover that information without having to query the OS and then work backwards toward a version. It might make sense to parse $PSVersionTable.OS but we'll have to see how that works in the various OS' we use. It hasn't been investigated yet.
@danieljurek: Are you saying we have cases where we want to know the OS version (e.g. Windows 2019 vs Windows 2022), rather than just Windows vs Linux vs Mac? In that case, I agree OSVmImage might be preferable to Agent.OS.
But I also know we have code that maps OSVmImage to one of the three operating systems, and I think that code could be replaced by Agent.OS.
I believe many of our scripts and YML use custom variables like
OSVmImage
to detect operating system. However, I think it might be better to use the built-in variableAgent.OS
instead.https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#agent-variables-devops-services
The text was updated successfully, but these errors were encountered: