While looking to automate the installation of Jenkins I needed to get a list of installed plugins into a plugins.txt file to be used by the automated install process. It’s possible to view them in the GUI, but not get an easy export:
It’s possible to query the API to get this information:
Note: my test Jenkins server is not https, hence the need for the AllowUnencryptedAuthentication parameter
Back Story Back in January 2017 Craig and I made PowervRA available for macOS and Linux via PowerShell Core. It was always our intention to do the same thing for PowervRO and , although slightly later than we hoped, we’re finally able to do that. PowerShell Core has come a long way itself over the last year, currently in Release Candidate and soon to be GA, and I’m sure a lot of the hard work and community feedback which has gone into that has helped make the job of PowervRO supporting PowerShell Core very straightforward.
Carrying out the following in Windows PowerShell worked, but didn’t always make a lot of sense because Byte is not really an Encoding type:
If you try to run the same command in PowerShell Core you will receive the following error:
Set-Content : Cannot bind parameter ‘Encoding’. Cannot convert the “Byte” value of type “System.String” to type “System.Text.Encoding”.
This is because Byte is no longer a valid selection for the Encoding parameter:
A few months ago we had an issue logged in PowervRA where it was not possible to make a connection to the vRA appliance after it had been locked down following the VMware hardening guide. Specifically this was because SSLv3/TLSv1 (weak ciphers) had been disabled.
By default, Windows PowerShell 5.1 has the following Security Protocols available, Ssl3 and Tls - hence the above failure.
It’s possible to workaround this by adding in the security protocol required, in this case TLS 1.
On Friday 22nd September a group of people involved with organising PowerShell User Group events around the UK will be hosting a 1 day PowerShell conference in London, PSDayUK. It will take place following on from the 2 day WinOps conference at the same venue, Skills Matter CodeNode, on Wed 20 - Thr 21st September.
Headlining the day is Steven Murawski - Cloud Developer Advocate at Microsoft. Then there will be two separate tracks of sessions with many great speakers from the PowerShell community:
When you make a change to a PowerShell Module Manifest and go to commit those changes in Git, I have observed for some time that it was not possible to see the actual changes in the file because Git was showing it as a binary file. I finally found out why this happens……
Take the following example. I’ve created a module manifest for a module Test with New-ModuleManifest:
Now I make a change to the manifest, say up the version to 1.
There are a number of different ways to filter data in PowerShell and the options have expanded since the original release of v1.0. I thought it worth summarising them here, particularly from my experiences of attempting to convey the different choices during PowerShell training I have delivered. Typically these revolve around a dataset and the word ‘where’ used in one form or another, however….
1) Filter on the left The number 1 rule is if possible use the filtering options of the cmdlet you are originally working with to reduce the size of the dataset.
There have recently been a number of blog posts around modifying the All Services icon in vRA, and how to change it programmatically:
http://www.vmtocloud.com/how-to-change-the-vra-7-2-all-services-icon/ - curl https://virtualbrakeman.wordpress.com/2017/03/17/replacing-the-all-services-icon-in-vrealize-automation/ - Python http://read.virtualizeplanet.com/?p=1539 - .Net http://michaelpoore.com/2017/03/how-to-change-the-vra-7-2-all-services-icon-using-vro/ - vRO We had a new feature request open in PowervRA for a while to do the same thing, so I figured it would be a good time to go and add it, so that the same change to the icon could be done from PowerShell.
There are a number of PowerShell User Groups in the UK, but unfortunately none for me that are easy to get to with my home location and work commitments. So I am gathering interest in a UK South Coast PowerShell User Group for coders of all experience levels.
The purpose of this initial meetup is to test the viability of running a PowerShell meetup in Southampton on a regular basis. Hopefully we will get enough interest to take this forward and start running sessions with PowerShell content for everyone to learn from.
PowerShell v6 Alpha 17 has been released and contains an interesting change with the version parameter when applied to powershell.exe. Some discussion around it can be found here and here.
When using a Linux based shell, supplying the version parameter returns the version of the shell:
You can now do a similar thing in PowerShell Core:
Note that using $psversiontable still gives you fuller information:
This is slightly different from the pre-v6 PowerShell version on Windows where the version parameter requires an argument: