PowerShell is .NET based but doesn’t load all available .NET assemblies when it starts.
Many people still use something like
to load additional assemblies. This is a hang over from PowerShell v1 when there wasn’t another way to perform the load.
The LoadWithPartialName method has been deprecated – https://msdn.microsoft.com/en-us/library/12xc5368(v=vs.110).aspx – and shouldn’t be used.
Your alternatives are:
Add-Type -AssemblyName System.Windows.Forms
or in PowerShell v5
using assembly System.Windows.Forms
using namespace System.Windows.Forms
can be used
A free ebook from Manning: Using the Web to Build the IoT is a collection of six hand-picked chapters that introduce the key technologies and concepts for building the application layer of the IoT. The page is here: http://bit.ly/1SUJW0P
The WinOps conference is dedicated to ‘Windows in a DevOps World’ Its in London 24 May 2016. I’ll be speaking as will Jeffrey Snover and Ed Wilson of Microsoft.
More details from http://winops.org/
Hope to see you there
An update – KB 3157663 – should be installed BEFORE installing any roles, features or applications into a TP5 system.
Finding the update isn’t easy – no links from the TP5 pages and doesn’t show in search on Bing or if search microsoft.com
You can find it here:
Lets hope RTM is a bit more organised
Microsoft have released Technology Preview 5 (TP5) of Server 2016 today.
Its available from MSDN and the evaluations site
Lots of new stuff to try out
So you have some data in csv format:
column1 column2 column3 column4
——- ——- ——- ——-
a1 b1 c1 d1
a1 b2 c1 d1
a1 b3 c1 d1
a2 b3 c1 d1
a2 b4 c1 d1
a2 b3 c1 d1
a3 b5 c1 d1
a3 b6 c1 d1
a3 b7 c1 d1
a4 b5 c1 d1
In a variable $cd
You want colum1 and column2 in a new variable
Simplest way is probably
$new1 = $cd | select Column1, column2
The *-Variable cmdlets don’t get out much so I thought examples using them would be useful
You could also use the New-Variable cmdlet
New-Variable -Name new2 -Value ($cd | select Column1, column2)
Set-Variable also works
Set-Variable -Name new3 -Value ($cd | select Column1, column2)
A few announcements from the PowerShell Team that I’m catching up on.
The Microsoft.PowerShell.Archive module is now open source
The archive module was introduced in WMF 5.0. Its now available on the PowerShell Gallery for installation on WMF 4.0. Any future updates will be through the gallery. The version in the gallery is 184.108.40.206 as opposed to 220.127.116.11 that ships with WMF 5.0
You can now view the contents of files directly in the PowerShell gallery
A DSC toolkit for working with Amazon Web Services (AWS) is now available
WMF 5.1 will become available when Windows Server 2016 ships
WMF 5.1 will contain the changes and bug fixes introduced since WMF 5.0 shipped. Many of these have been available on Windows Insider preview builds