Saturday, August 30, 2014

Documentation–documenting variables in a script/function

A few weeks ago, I gave a PowerShell course during which the issue of documentation came up. The point I made was documentation is a good thing – and the more the better. The delegates really liked the comment based help approach. But it often does not go quite far enough.

One additional thing you can do is to document individual variables. Each variable object lives in the Variable: drive. Variables are , like everything PowerShell, an object. When you get child items of a variable, the variable is returned of the type System.Management.Automation.PSVariable. There are some special PowerShell variables (QuestionMarkVariable, LocalVariable, SessionStateCapacityVariable, and NullVariable). All of these objects have a Description property which enables you to describe each variable.

So you could do this:

$I = ‘10.0.0.100’
(dir variable:I).description  = ‘the new IP address for the new server’
$iold = ‘10.0.1.200’
(dir variable:iold).description  = ‘the new IP address for the new server’
Dir Variable: | Format-Table name,description –a

I’ve not used this approach much, but I probably do so in the future for production scripts at least!

Friday, August 29, 2014

Azure Machine Learning – What is it and Doing it In Azure

Azure Machine Learning is another of those features of Azure I've not gotten around to playing with. Andrew Fryer of Microsoft has produced a couple of good articles on the subject, both in general and Azure specific.

Machine Learning appears to be the new marketing buzzword previously known as data mining. Given enough data, you can mine it to find gold is the basic concept. In his first article, Fryer looks at what Machine Learning (ML) is and some of the basic tasks. In the second article, Fryer looks at exploring and evaluation of the technique to see if it's of value to an organisation.

Desired State Configuration Resource Kit–Wave 6

The PowerShell team has just released an update to the DSC resource kit – bringing the total number of DSC resources to over 80! While the bulk of the resources in the resource kit are ‘experimental’ – they seem to me to be very stable (continuing the PowerShell team’s ability to ship rich, useful, and reliable beta code).

And even better, the PowerShell team seem to have gone back to their old roots in terms of time to market. They appear to be releasing as they develop (and long may this continue). Thus, the new SafeHarbor DSC resource, this was finished after Wave 5 was released but before Wave 6 was ready so the PowerShell team published it separately, then publish it (with updates and bug fixes) a few weeks later in the Wave 6 drop. I can’t tell you how good this feels after so long under the cone of silence.

This latest drop has some very interesting resources, including the xChrome and xFirefox resources that help to deploy these two browsers. The Group resource shipped with PowerShell 4 is updated to provide support for cross-domain account lookups as well as for UPN-formatted names. The new xRemoteDesktopAdmin resource enables. Additionally, Wave 6 has a number of bug fixes to earlier waves. Again – the ability to get these fixes quickly is both useful and much appreciated. 

The  DSC story is slowly coming clearer with both the July drop and these continuingly improving resources. And with Chef integrating with DSC, DSC’s future looks very rosy.  If you are looking to find out a bit more about DSC – I’ll be covering the basics on the PowerShell PowerCamp event in October.

Synchtoy–a free utility from Microsoft

I just stumbled across an interesting utility, called SyncToy. Version 2.1 of this tool is available, free, from Microsoft at: http://www.microsoft.com/en-us/download/details.aspx?id=15155. This is the latest version of this tool, which was first published in 2009, so it’s not really new.

This highly customisable tool synchronises files and folders between file locations, kind of like a robocopy designed just to synch your files between two locations. You could use this to sync files such as photos, music files etc. with other computers. This might be easier than worrying about backup for these files.

To find out more about Synchtoy, or to ask questions – see the synch toy forum at: http://social.microsoft.com/Forums/en-US/home?forum=synctoy.

del.icio.us Tags:

Tuesday, August 26, 2014

PowerShell V5 July 2014 Preview

As promised by Jeffrey Snover at TechEd US, Microsoft has released a new and updated pre-release version of PowerShell V5. Oddly, I can’t find too many references to it, but here is where you can get the preview:

Note that these versions only install on Windows 8.1 and Server 2012 R2. My main workstation runs Windows Server 2008 R2 and while I know it needs upgrading, I am dreading the upgrade. For now, I’m running this update on just my laptop. Sadly – as this update has a lot of new features.

The new features, described in more detail in the release notes, include:

  • Generation of Cmdlets based on an Odata Endpoint - Export-ODataEndpointProxy is a cmdlet that will generate a set of Windows PowerShell cmdlets based on the functionality exposed by a given OData Endpoint. This feature is still not quote complete as it’s still under development – but this looks a great idea to open up OData to wider use.
  • Manage .ZIP files with new cmdlets – finally two new cmdlets to manage zip files: Compress-Archive creates a new zip file while Expand-Archive allows un-zipping. At long last!
  • DSC authoring improvements in Windows PowerShell ISE. Several new features are added to the ISE to simplify authoring of DSC resources, including the ability to list all the DSC resources within a configuration block (use Ctrl+Space) and lots of improvements to autocomplete/tab complete.
  • Changes in how the DSC Local Configuration Manager is installed.
  • Partial DSC configurations – this, for me, was a missing piece to DSC. Partial DSC Configuration enables you to deliver configuration documents to a node in fragments. This is, for me, a great simplification in how you deploy DSC configurations.
  • Cross-Computer Synchronisation – this improves the built in WaitFor DSC resources. This is highly important for complex multi-node configuration scenarios where you need to sync several systems in order to properly configure them.
  • New DSC cmdlets – there are several new cmdlets, including Get-DSCConfigurationStatus, Compare-DNSConfiguration, Publish-DSCConfiguration and Update-DSCConfiguration.
  • The new Detailed Script Tracing feature enables detailed tracking and analysis of Windows PowerShell scripting use on a system. After you enable detailed script tracing, Windows PowerShell logs all script blocks to the ETW event log, Microsoft-Windows-PowerShell/Operational. If a script block creates another script block (for example, a script that calls the Invoke-Expression cmdlet on a string), that resulting script block is logged as well. I can see this being very, very useful!
  • The *-item cmdlets are extended to enable creation of symbolic links. Yet another cmd.exe feature now with PowerShell parity. YEAH!
  • And of course the latest WMF includes the cool features added to earlier versions, including OneGet, PowerShell Get, Network Switch management

PowerShell V5 is shaping up to be a pretty significant release, with a slew of really cool and, IMHO, important new features. I just hope there will be a version of PowerShell V5 for Windows 7/Server 2008 R2 so I can avoid the OS upgrade on my primary workstation.

Once I have this new update installed on my laptop, I’ll provide some additional feedback. I am looking forward already not only to playing with this new release, but in seeing what else Redmond and the PowerShell team have up their sleeves.

del.icio.us Tags: ,

Tuesday, August 12, 2014

Azure PowerShell DSC Extension

The PowerShell team have just published a new DSC extension to cater for Azure. You can find more information from the PowerShell team's blog post. he blog post shows yow you can use this extension. Before you use these cmdlets, you will need to have the Azure PowerShell SDK (0.8.6 or later) installed. See here to download the SDK.

del.icio.us Tags: ,,

Monday, July 14, 2014

PowerShell Summit Europe (Wish I Could Go!)

Just read more information about the PowerShell Summit Europe, to be held Sept 29-Oct 1st 2014, in Amsterdam (where there is quite a different meaning to the term: hash table).

Wish I could go! I'll have to hope that they will record sessions!

del.icio.us Tags: ,

Thursday, July 10, 2014

Satya Speaks–Towards a new Microsoft

I’ve been sitting in the garden, my Windows phone in my pocket, and browsing the web on my Surface RT. where I read with great interest Satya Nadella’s recent mail to Microsoft Employees. Microsoft kindly posted this email this morning at http://www.microsoft.com/en-us/news/ceo/index.html. Not only a smart move making the email before Mary Jo managed to get a leaked copy, but the contents are very exciting.

I opined a bit over a year ago that Microsoft needed new management. A view that did me no favors in parts of Redmond. The whole devices, phones and games vs. Azure vs. the ‘what keeps Microsoft afloat (Windows, Office, SQL, Exchange, Lync)’ was simply confusing. And the Cone Of Silence imposed by folks no longer at Microsoft was leading to a very closed culture which IMHO was not helpful for the customer.

But things have changed and that Cone of Silence seems to be a thing of the past. Jeffrey Snover noted at TechEd, The PowerShell team at least is back to working in Internet time as two new exciting builds of PowerShell V5 the team pumped out this year so far.

In July last year, Steve Ballmer set out a new direction, devices and services. That there was a new direction was a really good thing, as was Microsoft’s overarching goal of One Microsoft. And his departure and replacement with Satya was another major change. To me, he’s more than just a safe pair of hands!

But there was still confusion – why lead with the two areas Microsoft has been weak with (consider the relative success of Zune, Kin, Surface RT, BPOS, to name but a few) when the cash cows and technological leaders (Windows and Office) were put in a distant second place.  Satya notes that the ‘devices and services’ description was useful as a start, there is a need to hone on on a more detailed strategy (which is not so devices and services focused).

Today’s mail calls Microsoft ‘the productivity and platform company for the mobile-first and cloud-first world.’ To me this makes a log of sense and eliminates some of the confusion. It puts the platform in it’s place as just that, a platform. A platform to empower productivity. This approach seems to me to make a lot of sense. But as ever the devil is in the detail – Satya notes there is quite a lot of work to be done that will require nothing less than a complete transformation of Microsoft the company. That is a tall order, but the strategy sure seems sound.

The email also talks about the ‘Device OS.’ Which one is that going to be will be an interesting question for resolution. I personally love my Surface 1 RT. I use it daily as a device for consumption of content and some limited creation. Then there’s the Phone OS (I have Windows Phone 8.) It, too, has it’s moments. Finally, there is the traditional Windows as running on the Surface Pro and higher pc/server SKUs running on higher performance hardware. My use of traditional Windows is limited to my desktop and laptop, where I can type a whole lot faster than on the phone (and arguably more accurately). I think we have some interesting changes to the core product roadmap and I am looking forward to that being shared.

Microsoft is changing, and in a good way. The next couple of years is going to be very interesting. The Chinese curse: may you live in interesting times seems to have come home to roost! I look forward to the coming year.

del.icio.us Tags:

Monday, July 07, 2014

PowerShell PowerCamp–October 18-19th 2014

What is A PowerShell PowerCamp?
PowerCamp is a fast paced weekend training event that covers all the basic aspects of Windows PowerShell v5 - from the command line to writing production-oriented scripts and leveraging work flow and desired state configuration. We start with the basics including configuration, formatting and providers and remoting and jobs. Then, on day 2, we look at scripting, work flows, managing script libraries using modules, WMI/CIM,  using objects, and PowerShell in Windows. The event concludes with a look at the new Desired State Configuration feature in PowerShell 4 and 5.
The PowerCamp event is a combination of lecture, demonstrations plus Q&A, with the opportunity to type along with the tutor. There are no formal labs. But I do provide the key demos, all the slides, plus a wealth of other add on material on a memory stick you get at the start of day 1. So bring along your laptop, and type away.
What is the Agenda?
The event happens over the Weekend of October 18th and 19th. We start each day promptly at 9:00 and finish no later than 17:00.
Day 1 – The Basics
  • PowerShell Fundamentals – starting with the key elements of PowerShell (Cmdlets, Objects and the Pipeline) plus installation, setup, and profiles
  • What’s new in v5 – this looks at the things specifically added into PowerShell v5.
  • Formatting – how to format output nicely – both by default and using hash tables and display XML
  • Providers – getting into underlying OS data stores (certificate store, AD, registry, etc.) via providers
  • Remoting– working with remote systems using PowerShell’s remoting capabilities

Day 2 – Diving Deeper
  • Scripting Concepts – automating everyday tasks including PowerShell’s language constructs, error handling and debugging and workflows
  • Modules – managing PowerShell script libraries in the enterprise
  • Using .Net, COM, WMI and CIM objects – working with various kinds of objects
  • PowerShell in Windows – a look at what’s there and how you can leverage the huge number of cmdlets
  • PowerShell Desired State Configuration – this final module looks at PowerShell’s Desired State Configuration tool and what you can do with it.
What does it cost?
The cost is £200 (+VAT at the prevailing rate) for the weekend. Meals and accommodation are not covered.
Where is the event going to take place?
The PowerShell PowerCamp is being held at Microsoft Cardinal Place, 100 Victoria Street in Victoria. We will hold it on the weekend of October 18/19 2014. Each day starts promptly at 09:00 and finishes up by 16:45. We’ll also take short break throughout the day, including a 1-hour lunch break
PowerDrinks? After Saturday’s session, attendees are invited to a small nearby public house for some lovely English ale and networking with each other!
Who is the tutor?
The PowerShell Weekend PowerCamp is delivered by Thomas Lee. Thomas has been involved in the PowerShell community since the very beginning. He provides training and consultancy around a range of Microsoft products, with a recent focus on PowerShell and Lync Server. Thomas runs PowerShell training courses around the world, and has been a speaker at conferences across the world for the past decade. In his spare time, he lives with his wife, daughter, wine cellar, and Grateful Dead live recordings archive in a small cottage in the English countryside. His Twitter handle is @DoctorDNS and he maintains two blogs (Under the Stairs at http://tfl09.blogspot.com and PowerShell Scripts Blog at http://pshscripts.blogspot.com).
What do I need to bring?
You need to bring a laptop with PowerShell v5 loaded. That can be either native or in a virtual machine. I suggest you have at least two VMs pre-configured – one a server 2012 R2 installation the other a Windows 8 ,1installation. The virtualisation software is not of concern – but you need 64-bit guest OS support for Server 2012! Thus you can use Hyper-V, VMware Workstation or Oracle’s Virtual Box. Heck, run it in a VM on a Mac or Linux PC if you want. Just bring along PowerShell v3/4/5 (preferably V5!).
How do I book?
Contact DoctorDNS@Gmail.com to book a place and to arrange for the invoice to be paid. Payment must be in cash, cheque or bank transfer – I don’t take credit cards.
More Details
Watch this blog for any hot breaking news on the event.

Tuesday, July 01, 2014

PowerShell ISE Keyboard Shortcuts

I hit a recent issue using the ISE and trying to use the updated version of James Brundage’s ISEPackv2 module – a keyboard shortcut used in James’s module has been taken by a later version of PowerShell. Not the end of the world and easily remedied (heck, I have the code!). I was playing around with keyboard shortcuts and wrote a little function that, when run inside the ISE, gets the keyboard shortcuts that are set.
I’ve published the Get-ISEShortcut over on my PowerShell scripts blog, but the core of function is these lines of code:
$gps = $psISE.GetType().Assembly
$rm = New-Object System.Resources.ResourceManager GuiStrings,$gps
$rm.GetResourceSet((Get-Culture),$True,$True) |
    Where Value -CMatch "(F\d)|(Shift\+)|(Alt\+)|(Ctrl\+)"
This code gets the GUI related resource strings held by the ISE and then weeds out all but he keyboard shortcuts. In the published script, I sort them to get a more effective list. On my system, I get the following:
PSH [C:\foo]: Get-ISEShortcut | ft -AutoSize value, name
Value               Name                                          
-----               ----                                          
Alt+Backspace       EditorUndoShortcut2                           
Alt+Down            EditorSelectNextSiblingShortcut               
Alt+F4              ExitShortcut                                  
Alt+Left            EditorSelectEnclosingShortcut                 
Alt+Right           EditorSelectFirstChildShortcut                
Alt+Shift+Backspace EditorRedoShortcut2                           
Alt+Shift+Down      EditorBoxSelectLineDownShortcut               
Alt+Shift+H         ToggleHorizontalAddOnPaneShortcut             
Alt+Shift+Left      EditorBoxSelectToPreviousCharacterShortcut    
Alt+Shift+Right     EditorBoxSelectToNextCharacterShortcut        
Alt+Shift+T         EditorTransposeLineShortcut                   
Alt+Shift+Up        EditorBoxSelectLineUpShortcut                 
Alt+Shift+V         ToggleVerticalAddOnPaneShortcut               
Alt+Up              EditorSelectPreviousSiblingShortcut           
Ctrl+1              ShowScriptPaneTopShortcut                     
Ctrl+2              ShowScriptPaneRightShortcut                   
Ctrl+3              ShowScriptPaneMaximizedShortcut               
Ctrl+A              EditorSelectAllShortcut                       
Ctrl+Add            ZoomIn1Shortcut                               
Ctrl+Alt+End        EditorMoveCurrentLineToBottomShortcut         
Ctrl+Alt+Home       EditorMoveCurrentLineToTopShortcut            
Ctrl+B              BreakAllDebuggerShortcut                      
Ctrl+Backspace      EditorDeleteWordToLeftShortcut                
Ctrl+Break          StopExecutionShortcut                         
Ctrl+C              StopAndCopyShortcut                           
Ctrl+D              GoToConsoleShortcut                           
Ctrl+Del            EditorDeleteWordToRightShortcut               
Ctrl+Down           EditorScrollDownAndMoveCaretIfNecessaryShortcut
Ctrl+End            EditorMoveToEndOfDocumentShortcut             
Ctrl+F              FindShortcut                                  
Ctrl+F1             ShowCommandShortcut                           
Ctrl+F4             CloseScriptShortcut                           
Ctrl+G              GoToLineShortcut                              
Ctrl+H              ReplaceShortcut                               
Ctrl+Home           EditorMoveToStartOfDocumentShortcut           
Ctrl+I              GoToEditorShortcut                            
Ctrl+Ins            Copy2Shortcut                                 
Ctrl+J              ShowSnippetShortcut                           
Ctrl+Left           EditorMoveToPreviousWordShortcut              
Ctrl+M              ToggleOutliningExpansionShortcut              
Ctrl+Minus          ZoomOut3Shortcut                              
Ctrl+N              NewScriptShortcut                             
Ctrl+O              OpenScriptShortcut                            
Ctrl+Oem6           GoToMatchShortcut                             
Ctrl+Plus           ZoomIn3Shortcut                               
Ctrl+R              ToggleScriptPaneShortcut                      
Ctrl+Right          EditorMoveToNextWordShortcut                  
Ctrl+S              SaveScriptShortcut                            
Ctrl+Shift+Add      ZoomIn2Shortcut                               
Ctrl+Shift+D        GetCallStackShortcut                          
Ctrl+Shift+End      EditorSelectToEndOfDocumentShortcut           
Ctrl+Shift+F9       RemoveAllBreakpointsShortcut                  
Ctrl+Shift+H        HideHorizontalAddOnToolShortcut               
Ctrl+Shift+Home     EditorSelectToStartOfDocumentShortcut         
Ctrl+Shift+L        ListBreakpointsShortcut                       
Ctrl+Shift+Left     EditorSelectToPreviousWordShortcut            
Ctrl+Shift+Minus    ZoomOut4Shortcut                              
Ctrl+Shift+P        StartPowerShellShortcut                       
Ctrl+Shift+Plus     ZoomIn4Shortcut                               
Ctrl+Shift+R        NewRemotePowerShellTabShortcut                
Ctrl+Shift+Right    EditorSelectToNextWordShortcut                
Ctrl+Shift+Subtract ZoomOut2Shortcut                              
Ctrl+Shift+U        EditorMakeUppercaseShortcut                   
Ctrl+Shift+V        HideVerticalAddOnToolShortcut                 
Ctrl+Space          IntellisenseShortcut                          
Ctrl+Subtract       ZoomOut1Shortcut                              
Ctrl+T              NewRunspaceShortcut                           
Ctrl+U              EditorMakeLowercaseShortcut                   
Ctrl+Up             EditorScrollUpAndMoveCaretIfNecessaryShortcut 
Ctrl+V              Paste1Shortcut                                
Ctrl+W              CloseRunspaceShortcut                         
Ctrl+X              Cut1Shortcut                                  
Ctrl+Y              EditorRedoShortcut1                           
Ctrl+Z              EditorUndoShortcut1                           
F1                  F1KeyboardDisplayName                         
F1                  HelpShortcut                                  
F10                 StepOverShortcut                              
F10                 F10KeyboardDisplayName                        
F11                 StepIntoShortcut                              
F11                 F11KeyboardDisplayName                        
F12                 F12KeyboardDisplayName                        
F2                  F2KeyboardDisplayName                         
F3                  F3KeyboardDisplayName                         
F3                  FindNextShortcut                              
F4                  F4KeyboardDisplayName                         
F5                  F5KeyboardDisplayName                         
F5                  RunScriptShortcut                             
F6                  F6KeyboardDisplayName                         
F7                  F7KeyboardDisplayName                         
F8                  F8KeyboardDisplayName                         
F8                  RunSelectionShortcut                          
F9                  F9KeyboardDisplayName                         
F9                  ToggleBreakpointShortcut                      
Shift+Backspace     EditorDeleteCharacterToLeftShortcut           
Shift+Del           Cut2Shortcut                                  
Shift+Down          EditorSelectLineDownShortcut                  
Shift+End           EditorSelectToEndOfLineShortcut               
Shift+Enter         EditorInsertNewLineShortcut                   
Shift+F11           StepOutShortcut                               
Shift+F3            FindPreviousShortcut                          
Shift+F5            StopDebuggerShortcut                          
Shift+Home          EditorSelectToStartOfLineShortcut             
Shift+Ins           Paste2Shortcut                                
Shift+Left          EditorSelectToPreviousCharacterShortcut       
Shift+PgDn          EditorSelectPageDownShortcut                  
Shift+PgUp          EditorSelectPageUpShortcut                    
Shift+Right         EditorSelectToNextCharacterShortcut           
Shift+Up            EditorSelectLineUpShortcut 

Thursday, June 26, 2014

Top Windows PowerShell Experts/Resources on Twitter

I was pleased to see this recent article over on Petri.com. The article calls out some of the top PowerShell experts you can find on Twitter. I was pleased – as I was mentioned!

del.icio.us Tags: ,

Friday, June 20, 2014

PowerShell Console Short Cut Keys

Ever watched someone who really know all the keyboard short cuts as they type along? I've watched some folks and they are blazingly fast. One reason is that they do indeed know all the short cuts! Ed Wilson has just published a cool article on the PowerShell Console shortcut combinations.

I have to say, there were some I did not actually know!

Tuesday, June 17, 2014

PowerShell Profile Files – What's in Yours?

I've recently finished teaching a PowerShell course – and during the course we got into a long discussion on Profiles and how to best use them. With 4 or more (think ISE vs. Console, etc) profile files to pick from, what to you put into your profile file and which ones do you use? We had a lively discussion and decided that for the most part,just using Profile (this host, current user) is probably easiest as most systems have just one user logging in and that user (i.e. me/you) tends to just need two profiles (one for console and one for ISE).

But that leaves the question: what should I put into my profile. I just noticed a good Scripting Guys post showing what a number of Microsoft employees use in their profile files. This makes good reading, provides food for thought and has given me ideas of things I want to add to my profile. Happy reading.

More PowerShell Cmdlets for Azure

I just notices that Cerebrata have brought out a set of cmdlets for Azure. For an introduction, see: http://www.cerebrata.com/products/azure-management-cmdlets/introduction. From here you can also download the cmdlet.

These cmdlets are, to say the least, NOT cheap. UK Price is over £80 pounds. I suppose if you are doing a lot of work with Azure and PowerShell this is good value. There are volume licensing options. Depending on your need, you may decide to use the Microsoft cmdlets and make up the difference yourself.

del.icio.us Tags: ,

Monday, June 16, 2014

PowerShell OData Provider for OneGet and PowerShellGet

PowerShellGet and OneGet are two new technologies that Microsoft is introducing with PowerShell. In essence, OneGet enables you to find, install, and then use 'packages' from various package repositories (public and private). PowerShellGet enables you to find, install, and  then use PowerShell Modules. These technologies are baked into PowerShell V5 preview releases and presumably will be part of PowerShell V5 when that finally ships. The repositories include places like Chocolatey, and a new repository for PowerShellGet, the PowerShell Repository (Https://msconfiggallery.cloudapp.net). The latter is a repository that is hosted on Azure.

There is some similarity between these two technologies in that both use Open Data Protocol (OData) to access and use the repositories. Stefan Stranger has just published a cool article showing how to use Odata to query for the repositories using OData.  Stefan points out an Odata Profider, over on CodePlex. This provider enables you to access the various repositories using your normal DIR/CD cmdlets (well aliases!), like this (and click the graphic to see a bigger version!):

image

One nice touch to the Odata provider module – it comes with ah about_OData_Query help file that provides more information about the Odata provider. ALL add-in modules should do this.

Tuesday, June 10, 2014

Sitecore PowerShell Extensions – another 3rd party PowerShell Extension

It's great to see the wider software and hardware industry embracing PowerShell. Another company to do it is Sitecore, a web content management firm. Sitecore has just announced some PowerShell extensions you can take advantage of (assuming you use Sitecore). Read more about these cmdlets over on Mike Reynolds site. You can also download the actual cmdlets from SItecore's site.

Friday, June 06, 2014

Creating an Internal PowerShellGet Repository

One of the cooler things announced at this year's TechEd US was OneGet, a new public repository and supporting cmdlets for PowerShell modules. OneGet enables you to find and install useful PowerShell modules. This is pretty cool.

The initial repository is a public one - and that may not suit everyone. You may not want your users just loading stuff because they can. Likewise, you may not wish to publish corporate modules to a public repository, for any one of a number of reasons.

To resolve this problem, the PowerShell Team blog has just published a cool post, by John Slack, that describes how to setup an internal PowerShell Get repository. If you have a lot of modules and want to provide a self-service repository, this article shows you how. It also provides some additional background on PowerShell Get. This is great information which, imho, should be in any about_PowerShellGet help file. Sadly, there is no such help file as yet. We'll see if future versions of PowerShell include such a file.

Technorati Tags: ,

Thursday, June 05, 2014

Get TechEd Sessions – Using a PowerShell Script

One nice thing about TechEd, the contents are generally recorded and made available for download. This year, there's a cool PowerShell script to help you. Find out more about the idea over on the Windows IT Pro site, and go to the TechNet gallery to download the script.

BuzzNet Tags: ,

PowerShell Samples in TechNet

When I first started getting into PowerShell, I browsed the TechNet and MSDN libraries to find samples that illustrated the use of various MS technologies. To get better at PowerShell, I then converted these MSDN/TechNet samples into PowerShell, posted them to the Microsoft site as well to my own http://pshscripts.blogspot.com blog site.

At the time I began doing this, there was a nice library page for both TechNet and MSDN which showed a tag cloud of the samples that had been tagged and a leader board showing who’d submitted the most updates. With the work noted above, I quickly took top spot – and slowly but surely created a huge gap between me and the next busiest contributors (at time I had contributed more content to the Technet site than the next 9 together). For reasons I’ve never been told, much of this was taken away – there is no leader board any more, the tag cloud(s) are gone and the ability to add community content is much diminished.

Having said that, today I noticed something that really made me happy. Real PowerShell samples in Technet.  If you look at the page http://msdn.microsoft.com/en-us/library/aa394585(v=vs.85).aspx, you see a bunch of tasks you can undertake using WMI. In the days gone by,  had added a bunch of samples here, recoding the VB script samples into PowerShell.  What surprised me is that all MY samples are gone, but: there are now proper PowerShell samples included in some of the samples. Look, for example at http://msdn.microsoft.com/en-us/library/aa394600(v=vs.85).aspx – which shows using the registry – you can now see the samples where they belong.

In converting my samples to integrated samples, Microsoft has removed the attribution and has made some silly errors. For example, on http://msdn.microsoft.com/en-us/library/aa394600(v=vs.85).aspx?cs-save-lang=1&cs-lang=windows%2bpowershell#code-snippet-1 (on he first sample, $computer is defined but is not used for example). And someone has taken the attributes (like who wrote the sample) off.

It’s great to see samples using PowerShell being added into the TechNet library – long may this continue.

Technorati Tags: ,,,

Thursday, May 22, 2014

DSC For Linux

In a talk I'd never have imagined would happen, last week at TechEd US, Jeffrey Snover announced DSC for Linux. More information on that is provided on the Windows PowerShell team blog at: http://blogs.msdn.com/b/powershell/archive/2014/05/19/announcing-windows-powershell-desired-state-configuration-for-linux.aspx

While I don't know Linux well enough to provide a detailed comment, the resources shown in that post do not look like the complete set. Nevertheless, this is a great start. I look forward to hearing more and seeing additional resources being added.

Technorati Tags: ,,