microsoft / windows-dev-box-setup-scripts

Scripts to simplify setting up a Windows developer box
MIT License
1.5k stars 368 forks source link

Add operating system and edition checks (fixes #18) #78

Open thejsa opened 5 years ago

thejsa commented 5 years ago

Adds checks for operating system version, SKU, and architecture (where applicable) to WSL, Docker, Hyper-V, app removal, and developer mode enable scripts.

msftclas commented 5 years ago

CLA assistant check
All CLA requirements met.

yodurr commented 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?

thejsa commented 5 years ago

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.

thejsa commented 5 years ago

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.

AdmiringWorm commented 5 years ago

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.
yodurr commented 5 years ago

Thanks for doing this @thejsa I'll test this out this week.