Open thejsa opened 5 years ago
Hi @thejsa this is pretty cool to see. Thank you. I need to loop in others from Chocolatey as I'm not familiar with the way you're version checking. This does seem like a valuable addition.
Can we centralize the versioning checking logic into helper functions so the scripts can just say if (Is64Bit()) etc?
Can we centralize the versioning checking logic into helper functions so the scripts can just say if (Is64Bit()) etc?
Certainly; that seems far more elegant; I'll work on that.
Complete in commit f3bad0f - haven't been able to spin up a VM to test this commit yet (will be able to once my main box is back up) but testing the scripts individually seems to yield no problems.
Just throwing this out here, so people are aware of it:
chocolatey also have a helper to check compare for 64/32 bit called Get-OSArchitectureWidth (The following aliases is also available: Get-OSBitness
, Get-ProcessorBits
)
That helper can be used in two ways: Comparison:
if (Get-OSArchitectureWdith -Compare 64) {
# Do whatever work is needed to be done for 64bit OS's
}
Or get the actual bit
$bits = Get-OSArchitectureWidth # Will output either 32 or 64 depending on the architecture.
Thanks for doing this @thejsa I'll test this out this week.
Adds checks for operating system version, SKU, and architecture (where applicable) to WSL, Docker, Hyper-V, app removal, and developer mode enable scripts.