Monthly Archive

PowerShell

PowerShell articles – – February 2016

I’ve had 2 articles published this week.

 

The first one is on the Scripting Guy blog

https://blogs.technet.microsoft.com/heyscriptingguy/2016/02/08/should-i-use-cim-or-wmi-with-windows-powershell/

 

And looks at the WMI and CIM cmdlets showing why 99.99% you should be using the CIM cmdlets.

 

The second article is on the UK TechNet blog

http://blogs.technet.com/b/uktechnet/archive/2016/02/10/powershell-and-server-core.aspx

 

and discusses how to configure and administer a Windows Server Core instance. All of the techniques in the article use built in cmdlets – no scripting required

PowerShell Deal of the Day – – 31 January 2016

PowerShell in Action, Third Edition is Manning’s Deal of the Day Sunday 31 January 2016

 

Deal of the Day January 31: Half off Windows PowerShell in Action, Third Edition. Use code dotd013116au at https://www.manning.com/books/windows-powershell-in-action-third-edition

 

PowerShell in Depth, Second Edition is also available as part of the deal

 

Deal of the Day January 31: Half off my book PowerShell in Depth, Second Edition. Use code dotd013116au at https://www.manning.com/books/powershell-in-depth-second-edition

 

The deal will go live at Midnight US ET and will stay active for about 48 hours to account for time zones.

PowerShell editing options

I’ve used the ISE since it first appeared in PowerShell 2.0 but there are a couple of recent annocements that increase your code editing options

 

ISE previews will become available out of band rather than being tied to WMF/OS releases

http://blogs.msdn.com/b/powershell/archive/2016/01/20/introducing-the-windows-powershell-ise-preview.aspx

 

The preview ISE is a module you can download from the PowerShell gallery and runs side-by-side with your existing version of ISE

Currently this is a PowerShell 5.0 only option

The current preview  hasn’t changed much – its just to test the delivery mechanism. Look for updates approximately monthly.

 

The second interesting editing option is Visual Studio Code which has PowerShell support

http://blogs.msdn.com/b/powershell/archive/2015/11/17/announcing-windows-powershell-for-visual-studio-code-and-more.aspx

 

as well as a host of other languages. if you have to work across multiple languages this may be an option for you

 

Alternativley, if you use Visual Studio a lot you have the PowerShell Tools for Visual Studio option

http://blogs.msdn.com/b/powershell/archive/2015/04/19/do-not-delete-publish-powershell-tools-for-visual-studio-now-available.aspx

Rescuing IE favourites

I received the new Windows Insider Windows 10 build over the wekend and have just discovered that installing it wiped out my IE favourites – or at least those in folders.

 

I’d copied my favourites to Microsoft Edge when installing Windows 10 so I can copy everything back

 

IE favourites are stored at

Get-ChildItem -Path 'C:\Users\<user>\Favorites'

 

You can clean out the favourites:

Get-ChildItem -Path 'C:\Users\<user>\Favorites' | Remove-Item –Force

 

You will be asked to confirm the action.

 

Microsft Edge favourites are at

Get-ChildItem -Path 'C:\Users\<user>\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\
User\Default\Favorites' –Recurse

 

Copy them into the IE favourites folder

Get-ChildItem -Path 'C:\Users\<user>\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\
User\Default\Favorites' | Copy-Item -Destination 'C:\Users\<user>\Favorites' -Force -Recurse

 

Job done

PowerShell conferences 2016

April is going to be a very busy month. It starts with the PowerShell plus DevOps Global Summit in Bellevue, Washington - https://eventloom.com/event/login/PSNA16

 

The PowerShell Conference EU 2016 follows later in the month - http://www.psconf.eu/

 

I’ll be speaking and running pre-conference workshops at both events. Hope to see you at one or the other.

European PowerShell conference 2016

PowerShell Conference EU combines the former “Deutsche PowerShell Konferenz” and “PowerShell Summit EU” into one great big 3-day PowerShell event for Admins and DevOps in Europe and takes place April 20-22 in Hannover/Germany. With more than 40 international speakers including PowerShell inventor Jeffrey Snover, and more than 60 sessions, you are cordially invited to join this massive European PowerShell event. The agenda is up on www.psconf.eu, and registration is open. Seats and hotel capacity are limited so don’t wait and register!

 

Psconf.eu is partnering with powershell.org and psconf.asia, and together we want to ensure that you have a comprehensive local PowerShell conference in your region of the

Happy New Year 2016

A new year and a number of things to which we can look forward.

The re-release of WMF 5.0. The WMF 5.0 download was pulled because a bug was over writing the module path. Look fot the download being available again soon.

Windows Server 2016 – Containers and Nano server give lots of new options for deployment and lots of new PowerShell to play with. There may even be other PowerShell changes – who knows given the new release processes.

In early April we have the PowerShell + DevOps Summit in Seattle. Late April sees the European PowerShell Conference in Hanover (tracks in German and English). Registration for both events is open.

The UK PowerShell group is reviving. After meetings in London and Manchester planning is underway for the next meetings – look for more info soon.

PowerShell in Action, third edition will appear.  Its already in early release and will complete this year.

A few other projects are in the pipeline which may or may not come to fruitition.

One prediction I can confidently make is that 2016 will NOT be the year that Unix/Linux conquers the desktop Smile

Infrastructure as Code article

My Infrastructiure as Code article – part of an introducing DevOps series – has gone live http://ed-baker.com/devops-practices-infrastructure-as-code/

You can also link to it through http://blogs.technet.com/b/uktechnet/ where you’ll find the first in my series of article on PowerShell. Second one will be coming in the New Year

Scripting Guy gets Pestered

The Scripting Guy blog has been running a series on Pester written by Dave Wyatt – the modules author.

 

Pester provides a way to perform, and automate, testing on your PowerShell code.

 

The series is:

http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/14/what-is-pester-and-why-should-i-care.aspx

 

http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/15/getting-started-with-pester.aspx

 

http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/16/unit-testing-powershell-code-with-pester.aspx

 

http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/17/testing-script-modules-with-pester.aspx

 

http://blogs.technet.com/b/heyscriptingguy/archive/2015/12/18/more-pester-feature-and-resources.aspx

New ScriptAnalyzer

A new version of Script Analyzer is available for download - http://blogs.msdn.com/b/powershell/archive/2015/12/17/scriptanalyzer-v1-2-0-released.aspx

A number of the rules have been updated and some new ones added