Friday, November 20, 2015

Doing 1 thing each day using Powershell

While at Ignite on the Gold Coast this week, it became very obvious to me that there are some really key technologies that I need to be across.  Watching people develop code and seeing them zip around using the Command line and various package managers highlighted where things are at with the developer workflow.

Technologies that I have committed to being across are:
  • Yeoman
  • Powershell
  • Git
  • Grunt/Gulp
  • Chocolatey
  • Visual Studio Team Services
To ensure that I remain curious and stay on track, I'm going to try and do one thing with Powershell each day.  Today's task is…

Delete project.lock.json files from a solution
This was a bigger issue in the past than it seems to be now, but I found that I regularly needed to manually delete the DNX lock files that were being generated by dnu.

The final product:

gci "\repos\dneimke\EF7Demo.CoffeeStore\*" -include "project.lock.json" -recurse | foreach($​_) {rm $ _​.fullname}

What I Learned:
  • The Get-Help cmdlet is a great resource for learning about how other cmdlets work
  • Get-Alias lists the aliases for all cmdlets
  • Get-ChildItem takes a -Path which makes it easy to list items in a folder - e.g. Get-ChildItem -Path \repos\test
  • Include seems to be the better way to target a specific pattern of file rather than -Filter

Resources:

No comments:

Post a Comment