A while back, I wrote a bit of a rant about the difficulties in finding helpful resources on writing PowerShell 2.0 cmdlets in C#. In case you hadn’t read it, my point was that there’s literally tons of great resources on authoring PowerShell scripts, but very little comparatively on how to author your own binary script modules. I still stand by that assessment regarding binary modules, however, I received some great advice recently that really helped me understand the learning curve involved in transitioning from a PowerShell scripter to a module author, and I’d like to pass that advice along.
[Read more…] about Some tips for writing your first PowerShell cmdlets & modules
PowerShell
PowerShell module for VIO-4001/4004
As I’ve mentioned before, I work as a sales engineer for Virtensys, a company that provides a very cool PCIe-based I/O virtualization appliance. Lately I’ve been working on an unofficial project to develop PowerShell cmdlets that will allow the provisioning of virtual I/O to servers connected to our VIO appliances.
Here’s a *very* informal demo I cut over the weekend demonstrating the functionality available in the first release of the PowerShell cmdlets for the VIO-4001/4004 appliances.
A great use case I have in mind would be combining my PowerShell cmdlets with VMware’s PowerCLI when provisioning/scripting VMware hosts & clusters.
(Video after the jump)
[youtube]q2pCouYlBuM[/youtube]
C#, WSDL, PowerShell cmdlets — Oh my!
Lately I’ve been working on trying to author PowerShell cmdlets with Visual Studio 2010 to talk to a web service. At first glance, I thought it would be easy. I had the WSDL and XSD files, and the webservice side of things is already working. There’s a web GUI that communicates via SOAP to the underlying hardware & software — building some cmdlets should be a snap, or so I thought.
First up, I must admit that I have zero C# experience. I’ve got a good amount of object oriented programming and scripting experience, so the concept of looping, conditionals, arrays, objects, methods, properties, etc. are not foreign to me. I’ve always believed, all things being equal, that programming is essentially all the same. Just like a spoken language, you have to understand the concepts of communicating effectively with other people and concepts such as I/you/us/them, adjectives, adverbs — only the sounds your mouth makes changes. Programming is very much the same way: same concepts for the most part but the language changes. With that semi-naive belief in hand, I bravely started Googling and reading MSDN.
[Read more…] about C#, WSDL, PowerShell cmdlets — Oh my!
NetApp Data ONTAP PowerShell Toolkit 1.3 released!
Rejoice, NetApp PowerShell users, for Toolkit 1.3 has dropped. There’s a bunch of new features and improvements in this release. Some new features that caught my eye are SSH Invocation and PowerShell provider. SSH Invocation (Invoke-NaSSH) allows you to send Data ONTAP CLI commands to your filer(s) via SSH. The PowerShell provider makes PowerShell drives available that correspond to the file system on the Data ONTAP controllers. This means that you can now read & write directly to the file system using the same semantics as the PowerShell FileSystem provider.
[Read more…] about NetApp Data ONTAP PowerShell Toolkit 1.3 released!
NetApp PowerShell Credential Bug (Fixed!)
Update: This has been resolved in the 1.3 release of the Toolkit.
I ran into a bug while trying to write a script that would cycle through all of my NetApp filers and change the root password. The issue was that I was unable to pass a PSCredential object to Connect-NaController because passing credentials meant that HTTPS/HTTP would be tried instead of the default and insecure RPC.
After working with Clinton Knight from the NetApp Communities, he determined that the toolkit was attempting to use Internet Explorer’s proxy settings. He was kind enough to provide a workaround, as follows:
[powershell]
[System.Net.WebRequest]::DefaultWebProxy = $null
[/powershell]
Until a permanent fix is introduced to the toolkit, put that snippet at the top of your NetApp PowerShell scripts, and you’ll be able to supply credentials (or -ForceSecure/-ForceUnsecure) to your Connect cmdlets.