Yay bash! Still have not found a good powershell replacement for grep… sure there is ‘select-string’ but meh…

Anyways how to install bash on Windows 10:

  1. Make sure you have the right version of Windows 10 and the Anniversary Update installed!
  2. Start -> Settings -> Update & Security -> For Developers -> Activate Developer Mode
  3. Go with Programs and Features (appwiz.cpl) and click on ‘Turn Windows features on or off’
  4. You should now see “Windows Subsystem for Linux (Beta)
  5. Install it and run bash
  6. Now the most frustrating part, you have to sign in to the windows store and accept the TOS <pre class="lang:default decode:true"># Alternatively, this should work too! lxrun /install /y</pre>

  7. Once finished you should have “Bash on Ubuntu on Windows”

  1. Install Python 2 ( download it from here )
[See bottom notes about why **Python 2**, not 3].   2. Open PowerShell and type _python_   3. If you get an error define the environment variable to know about python <pre class="lang:ps decode:true ">[ENVIRONMENT]::SETENVIRONMENTVARIABLE("PATH", "$ENV:PATH;C:\PYTHON27", "USER")</pre>

Close PowerShell and open it again and try _python_ again.

If done right, you should see something like this:
  
[<img class="aligncenter wp-image-556" src="http://blog.vvittig.com/wp-content/uploads/2016/09/python-300x52.png" alt="python" width="600" height="105" srcset="https://blog.vvittig.com/wp-content/uploads/2016/09/python-300x52.png 300w, https://blog.vvittig.com/wp-content/uploads/2016/09/python-768x134.png 768w, https://blog.vvittig.com/wp-content/uploads/2016/09/python.png 789w" sizes="(max-width: 600px) 100vw, 600px" />](http://blog.vvittig.com/wp-content/uploads/2016/09/python.png)Hooray, we have Python 2 now installed.
  
To exit Python you can type _exit()_</li> </ol> 

Note: Why Python 2 vs Python 3 to get started:

> A programmer may try to get you to install Python 3 and learn that. Say, &#8220;When all of the Python code on your computer is Python 3, then I&#8217;ll try to learn it.&#8221; That should keep them busy for about 10 years. I repeat, _do not use Python 3_. Python 3 is not used very much, and if you learn Python 2 you can easily learn Python 3 when you need it. If you learn Python 3 then you&#8217;ll still have to learn Python 2 to get anything done. Just learn Python 2 and ignore people saying Python 3 is the future.

Source: <https://learnpythonthehardway.org>

As this is a very common ‘issue’ I am just going to post the quick-fix:

If you have internet:

DISM /online /enable-feature /featurename:netfx3 /all

Install from install media:

# Where 'd' is the drive the install media is mounted to. You might have
# to change it if your media is on a different drive letter
DISM /Online /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:d:\sources\sxs

 



Need to set pics in AD, here a quick way to do it with #powershell

$username  = Read-Host 'Please enter the sameaccountname'
$pathtopic = Read-Host 'Please provide the picture path'

# Set picture
$Picture   = [System.IO.File]::ReadAllBytes("$pathtopic")
Set-ADUser $username –add @{thumbnailphoto=$Picture}

# Download picture
$User      = Get-ADUser -identity $username –properties thumbnailphoto
$pathtopic = 'C:\Export.jpg'
[System.Io.File]::WriteAllBytes ($pathtopic, $User.Thumbnailphoto)

If you are more comfortable with a GUI, codetwo.com has a free tool that will give you the same functionality.