Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect if running on Windows 10 #18

Open
gep13 opened this issue May 1, 2018 · 7 comments
Open

Detect if running on Windows 10 #18

gep13 opened this issue May 1, 2018 · 7 comments

Comments

@gep13
Copy link
Collaborator

gep13 commented May 1, 2018

Just thinking about this:

https://github.com/Microsoft/windows-dev-box-setup-scripts/blob/bcaad0c2f29f29369b77c41ada0d9a6db1e3beab/dev_app.ps1#L17

It might be a good idea to detect whether this script is running on a Windows 10 machine, otherwise this is going to fail.

An example of OS detection can be seen in the Chocolatey Script for PowerShell here:

https://chocolatey.org/packages/PowerShell#files

@WSLUser
Copy link

WSLUser commented May 9, 2018

A simple if statement should suffice in which you run winver and if it's below 14393, it ignores the install step and if => proceed to install.

@bcurran3
Copy link

bcurran3 commented May 9, 2018

Along those lines...

choco install -y Microsoft-Hyper-V-All -source windowsFeatures

...needs checking too:

The Hyper-V role is only available in the x64 variants of Windows Server 2008, Windows Server 2008 R2 Standard, Enterprise or Datacenter edition, Windows Server 2012 Standard or Datacenter edition, Windows 8 (or 8.1) Pro or Enterprise edition, or Windows 10 Pro, Education or Enterprise edition.

@WSLUser
Copy link

WSLUser commented May 9, 2018

WSL is only available in x64 variants of Server 2016 that released from FCU and up as well as Win 10 build 14393 as well. Nice catch. Guess that hypothetical simple if statement got alittle bigger since it would also need to check which arch it's running in.

@ferventcoder
Copy link
Collaborator

If only there was a package manager that could handle this 😄

@thejsa
Copy link

thejsa commented Oct 26, 2018

Working on this.

@thejsa
Copy link

thejsa commented Oct 26, 2018

Done (#78)!

@yodurr
Copy link
Contributor

yodurr commented Nov 21, 2018

it looks like @thejsa has this almost ready to commit to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants