Victor Vogelpoel

Excellence is in the details


1 Comment

Putting PowerShell to good use: discovering the OpenText eDOCS WCF API

Intro to the series “Putting PowerShell to good use”

Another post in the series “Putting PowerShell to good use”. In my company, I am evangelizing PowerShell use for various purposes and it is starting to gain traction. PowerShell is not just for the system administrator, but a great tool for any developer as well. It lends itself well for all sort of tasks:

  • Discovering APIs;
  • Leveraging APIs;
  • Creating APIs;
  • Deployment;
  • Testing.

In these series “Putting PowerShell to good use”, I want to share here how I have been using PowerShell. In this second post: discovering APIs with PowerShell and learning about the Windows Communication Foundation (WCF) services API for eDOCS DM, a.k.a. the eDOCS DM WCF API.

The posts of the series so far:

  1. Discovering the eDOCS DM COM API
  2. Discovering the eDOCS DM WCF API (this post)

TL;DR

This new job at The ONE introduced me to OpenText eDOCS Document Management. This time I will be looking at the WCF API of eDOCS DM using PowerShell. Continue reading


1 Comment

Putting PowerShell to good use: discovering the OpenText eDOCS COM API

Intro to the series “Putting PowerShell to good use”

Five years ago, PowerShell fell into my lap and never left my lab again. PowerShell is not just for the system administrator, but a great tool for any developer as well. It lends itself well for all sort of tasks:

  • Discovering APIs;
  • Leveraging APIs;
  • Creating APIs;
  • Deployment;
  • Testing.

In these series “Putting PowerShell to good use”, I want to share here how I have been using PowerShell. In this first post: discovering APIs with PowerShell and in this post discovering the OpenText eDOCS COM API.

TL;DR

This new job at The ONE introduced me to Open Text eDOCS Document Management (previously Hummingbird) and Ultimus Business Process Management. Learning these products and leveraging their APIs for creating integration solutions is a bit of a challenge. PowerShell has been a great help in discovering the eDOCS API and its workings.

Continue reading


Leave a comment

PowerShell on Windows 10 IoT on Raspberry PI

Microsoft has released a preview of the Windows 10 IoT (Internet of Things) for embedded devices, one of them being the Raspberry PI 2B. I am curious to what extent PowerShell can be used on such a limited device; using remoting, PowerShell is supposed to be the preferred way to configure and control the little machine.

Now, I don’t have Windows 10 Desktop preview in order to flash a SD card with the Windows 10 IoT image. However, following the instructions on page https://www.raspberrypi.org/forums/viewtopic.php?f=105&t=109105 (and the video!), I was able to flash the SD card using a Windows 8.1 laptop and complete the installation on my PI
Continue reading


Leave a comment

PowerShell: Download SharePoint Connect 2014 Amsterdam slides from SlideShare.net (using SlideShare API)

Last November I had the pleasure of attending the SharePoint Connect 2014 Amsterdam conference at De Meervaart Theatre. Organizer NC Communication was nice enough to share the slides on SlideShare.net at http://www.slideshare.net/nccomms/ with the prefix title “SPCA2014”.

There are about 25 slide decks and the amount of clicking to download them is daunting! Time for a PowerShell script!
Continue reading


Leave a comment

The PowerShell advantage: debugging anytime

Today I was reminded of a great PowerShell feature: I can even debug script on a production server. Take that, compiled C# program!

The system administrator installed scripts I devised to update SharePoint online User Profile properties in bulk, but something failed in our tests. Well, just open PowerShell ISE, load the culprit script, set a break-point, start it and see what’s happening.

Oh, we forgot to set the IE proxy properly, so the script had no connection to internet. Easily found and fixed and the scripts started to work their magic.
Got to love PowerShell!


2 Comments

PowerShell: Get-WSManCredSSPConfiguration: getting CredSSP configuration for local or remote computer

CredSSP is a security provider to help delegate credentials from a client computer to a target computer. In PowerShell, we can use CredSSP to overcome the double-hop authentication problem. Getting the current CredSSP configuration settings for client and target computer is a bit of a pain, though. My function Get-WSManCredSSPConfiguration helps with gathering the current CredSSP configuration on both local and target computers. Continue reading


Leave a comment

PowerShell: Measure-ScriptCode (calculating script code metrics)

In my current project for a client, me and my team are building an hefty framework in PowerShell 3. I was wondering how many lines of code and other metrics the framework script code would span. I asked Dutch PowerShell MVP Jeff Wouters (http://jeffwouters.nl) if he knew a tool for calculating PowerShell code metrics, but he didn’t know any. Well, I spent a little time in my Christmas holiday to come up with a tool of my own: Measure-ScriptCode. It was surprisingly easy to calculate metrics.

Continue reading


Leave a comment

PowerShell: Resolve-FQDNHostName

My current project involves scripting an installation and and configuration of several Microsoft products onto a myriad of servers. I found it very useful to resolve the fully qualified hostname (FQDN), for a server hostname, hence the function Resolve-FQDNHostname.

The function will use the active directory to resolve a hostname to a fully qualified hostname

function Resolve-FQDNHostName
{
  [CmdletBinding()]
  param
  (
    [Parameter(Mandatory=$false, position=0, ValueFromPipeLine=$true, ValueFromPipeLineByPropertyName=$true, HelpMessage="TODO")]
    [Alias('CN','__SERVER', 'Server', 'Hostname')]
    [String[]]$ComputerName = "localhost"
  )

  process
  {
    foreach ($comp in $ComputerName)
    {
      if ($comp -eq ".") { $comp = "localhost" }

      Write-Output ([System.Net.Dns]::GetHostByName($comp).HostName)
    }
  }
}

Examples of use:

  • Resolve-FQDNHostname
    without any arguments will return the FQDNHostname for the current server
  • Resolve-FQDNHostname -computerName server1
    will return the FQDNHostname for “server1”: “server1.domain.local”
  • Resolve-FQDNHostname -computerName server1,server2,server3
    will return the FQDNHostnames for each specified server
  • If the server cannot be resolved, the function will throw an exception: Resolve-FQDNHostName : Exception calling “GetHostByName” with “1” argument(s): “No such host is known”


Leave a comment

SharePoint (2007) deployments controleren met PowerShell test framework

Dit artikel is 3 oktober 2013 ook verschenen op de site van de Nederlandse SharePoint community SPCNL.nl.

De volgende technieken zijn ook heel goed bruikbaar bij de recentere SharePoint versies; de tests en scripts hieronder zijn oorspronkelijk geschreven voor SharePoint 2007.

De scripts uit dit artikel kun je vinden in het bijgesloten ZIP 20130923Test-PortalDeployment.zip.

De afgelopen jaren is elke drie jaar een nieuwe versie van SharePoint verschenen, maar overstappen naar een nieuwere versie is helemaal niet zo vanzelfsprekend. Soms blijft een klant nog even hangen bij die versie die het op dat moment goed genoeg doet. En met SharePoint 2007 krijg je meteen een uitdaging om deployment van componenten robuust te regelen, zeker als er sprake is van twee ontwikkelstraten met tussen de 1 en 5 servers in elke omgeving.

Omdat er veel herhaalde handelingen zitten in een deployment, is het scripten van deze handelingen echt een noodzaak. Niet alleen omdat je menselijke uitvoeringsfouten uitsluit, maar ook voor volledig geautomatiseerde uitrol. Een nachtelijke build moet de volgende ochtend klaar staan op een ‘development integration’ omgeving voor intake door de testers, waarbij de vorige build eerst netjes wordt verwijderd en vervolgens de verse build wordt geïnstalleerd. Na wat initieel gepeuter met CMD/BAT files en STSADM kwam ik in aanraking met PowerShell en ontdekte al snel dat ook SharePoint 2007 heel goed te manipuleren is met deze ‘task automation framework’ van Microsoft, maar ook om een deployment van een SharePoint oplossing goed is te controleren, in combinatie met een testing framework PSaint.

Continue reading