Monthly Archive

PowerShell

PowerShell Summit NA 2015 Agenda changes

We’ve had to make some minor changes to the Summit agenda – the revised schedule is shown on the event web site - http://eventmgr.azurewebsites.net/event/home/PSNA15

PowerShell Heroes 2015

Powershell.org has announced the 2015 list of PowerShell Heroes- http://powershell.org/wp/2015/01/17/announcing-our-2015-powershell-heroes/

 

These are people who have made an outstanding contribution to the PowerShell community but have not been recognised in other ways (such as an MVP award)

 

Please join me in congratulating them

DHCP scope lease time

I wanted to reduce the lease time on a DHCP scope

 

$lt = New-TimeSpan -Hours 12
Set-DhcpServerv4Scope -ScopeId 10.10.54.0 -LeaseDuration $lt

 

You could even make it a one liner if you wished

 

Set-DhcpServerv4Scope -ScopeId 10.10.54.0 –LeaseDuration (New-TimeSpan -Hours 12)

PowerShell Summit Europe 2015–topic submissions

Topic submissions for the PowerShell Summit Europe are still open. If you want to be considered as a speaker please submit your topic very soon.

 

At the moment there aren’t enough submissions to enable us to put on a quality event. The 2014 European Summit was an excellent event with many good sessions – now is the time to submit your sessions. We need your sessions.

 

We have a policy of accepting sessions from new speakers as well as established experts. It’s not who you are but the quality of the session that counts.

 

Details on how to submit session proposals are available here

http://powershell.org/wp/2014/11/24/call-for-presentations-for-powershell-summit-europe-2015/

 

Please submit your proposals soon as we can’t run the European PowerShell Summit without them

PowerShell in 2015

See Don Jones’ predictions for PowerShell in 2015 - http://blogs.technet.com/b/heyscriptingguy/archive/2015/01/01/powershell-predictions-for-2015.aspx

PowerShell Summit NA 2015

We will be getting extra capacity for the PowerShell Summit NA 2015 in Charlotte. The extra places should become available 11 January 2015 – see http://powershell.org/wp/2014/12/30/powershell-summit-n-a-2015-additional-capacity/

 

for details. 

Please check the powershell.org site for further news

PowerShell review of 2014

See my review of 2014 from a PowerShell perspective on the Scripting Guy blog - http://blogs.technet.com/b/heyscriptingguy/archive/2014/12/31/2014-a-powershell-year-in-perspective.aspx

Merry Christmas from the PowerShell team

The PowerShell team have produced wave 9 of the DSc resource kit – just in time for Christmas - http://blogs.msdn.com/b/powershell/archive/2014/12/17/another-holiday-present-from-the-powershell-team-dsc-reskit-wave-9.aspx

This wave contains a number of new resources and some updates to existing resources including the Exchange resource.

You can download the latest version of the resource kit from  https://gallery.technet.microsoft.com/DSC-Resource-Kit-All-c449312d

The team’s blog post states that you should check for the GA update (which is minimum requirement for running the DSC res kit) by testing to see if KB2883200 is installed. This won’t work if you’ve built you system using Windows media that incorporates the update.

A better test is to look at the build number. It should be 9400 or higher. You can see this by using $psversiontable

£> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34014
BuildVersion                   6.3.9600.17400
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

The version is  6.3.9600.17400  where 6.3 = Windows 2012 R2 and 9600 = the build

You can also use WMI

£> Get-CimInstance -ClassName Win32_Operatingsystem | Format-List BuildNumber, Version

BuildNumber : 9600
Version     : 6.3.9600

European Summit 2015 call for topics #2

The call for topics for the European PowerShell Summit is still open - http://powershell.org/wp/2014/11/24/call-for-presentations-for-powershell-summit-europe-2015/

Please submit your topics by the deadline of 11 January 2015.

 

A few people have suggested subjects for topics they would like to see:

Azure automation with SAM and/or workflows

SCCM advanced scripting

DSC advanced scripting

Pester

Test Driven Deployment with Pester

Deep dive integration of .NET and Win32API with PowerShell

 

Could you provide a session on one of these or another topic?

We will have a number of established speakers and PowerShell personalities attending but at all of the powershell.org Summits we like to take the opportunity to encourage new speakers.

 

If you’re not sure of a topic’s suitability or whether you should submit please get in touch and I’ll be happy to discuss

Add a drop down to a Word document

 

Its surprisingly easy to programatically add a drop down list to Word document

 

$Word = New-Object -Com Word.Application
$word.visible = $true
$template = "c:\test\template.docx"  
$Doc = $Word.Documents.Open($template)
$Doc.Activate()   

$cntrl = [Enum]::Parse([Microsoft.Office.Interop.Word.WdContentControlType], "wdContentControlDropdownList")

$objCC = $doc.ContentControls.Add($cntrl)

$objCC.DropdownListEntries.Add("PowerShell")
$objCC.DropdownListEntries.Add("Ruby")
$objCC.DropdownListEntries.Add("Perl")

 

Create the COM object for Word and set visible.  Open a template (in this case a blank document) file and activate.

 

Set the type of control you want to add and define the possible entries.

 

It should be possible to set the default text but the method for doing that appears to be very awkward.  I’ll publish that if I work it out.