Octopus Deploy and Verbose Octopus Deploy provides the ability to run PowerShell scripts natively. However, Octopus Deploy can only consume 3 streams when generating logging information: Standard out Warning Error Replacing use of Write-Verbose with Write-Output (standard
Migrating to Pester 4.0.7 Pester 4.0.7 changes the name of the "Contain" assertion. This script rewrites script files in two ways: It injects "-" before Not, Be, and so on. It
Coding conventions and PSScriptAnalyzer PSScriptAnalyzer is a static analysis tool, it examines source code and flags issues based on configured rules. PSScriptAnalyzer comes allows a developer to define and inject their own rules using the CustomRulePath parameter.
Cmdlets without a dll PowerShell defines a number of different types of command. Functions are written in PowerShell (normally), and Cmdlets are written in a compiled language (C# more often than not). Classes, introduced with PowerShell 5,
PowerShell: .NET 4.0 zip file handling The .NET Framework 4.0 brought an upgrade to the System.IO.Compression classes allowing native handling of zip files. The two scripts below demonstrate compression and expansion uses these classes. The relevant
Dynamic parameters This short function simplifies the creation of dynamic parameters. The function exposes each of the possible validators as well as a few of the less well known options for ValidateSet and ValidatePattern.
Testing LDAPS I’ve recently bumped into a need to verify certificates deployed for LDAPS on Active Directory. PowerShell remains my tool of choice for such occasions as this. It is possible to very simply
PowerShell file-based binary search I thought I’d share my binary (half-interval) searcher implementation. The searcher may be used for finding text in a pre-sorted text file. The advantage of a binary search is that it is
ConvertTo-Subnet A new function has been added to Indented.NetworkTools: ConvertTo-Subnet. ConvertTo-Subnet is part of Indented.Net.IP. Indented.Net.IP can be installed from the PowerShell Gallery. Install-Module Indented.Net.IP
DIY My wife and daughter are away for a month so I elected to do a little bit of DIY. This is how it went. I set myself a task: To strip, trim and
Get-InstalledSoftware Get-InstalledSoftware reads uninstall registry keys from a host, it will also read Uninstall keys from loaded user hives (HKEY_USERS). Get-InstalledSofware does not load hives, a user must have been logged on (at
Spiceworks minus Administrator How to set up an account to scan Windows devices from Spiceworks without administrator level rights. Step 1: Create a group which can be used to grant access to WMI WMI permissions may
Membership trees This post shows two functions to draw member trees. The functions are almost identical, a variation on a theme. The first shows group membership by following memberOf, the second shows members of a
A few zabbix templates I bumped into Zabbix again recently and needed to put together a few templates to improve the monitoring for a few of the Microsoft systems. It could be just me, but it seems
New-Enum The code below allows creation of .NET enumerations in PowerShell without using Add-Type. Before an Enum can be created a Dynamic Assembly and Module must be created. The function below creates the module
ADSystemInfo ComObject This function adds members to an instance of ADSystemInfo in an attempt to simplify use. All properties and methods for the IADsADSystemInfo interface have been accounted for. The return type is the original
Juniper JunOS show interfaces I’ve been doing a lot of work with Juniper SRX firewalls recently; JunOS allows administrators to build scripts using either XSLT or SLAX. This is a little SLAX script variant of “show
WhoIs in PowerShell There are a number of WhoIs scripts knocking around, this is my version. Something of a long development cycle since I started this last year, got busy, then finished it today. Get-WhoIs has
PuTTY and PowerShell A friend of mine found this enormously useful, one of the things PowerShell can do easily that is (apparently) helpful for people who want nothing to do with it otherwise (where it may
More IPv4 subnet maths with PowerShell I’ve been extended and upgrading my library of network functions for some time now, I thought I’d post the functions that work directly with my original collection. The functions described here
Get-LocalGroupMember A quick PowerShell 2 function for a Monday evening. A function to return properties from the WinNT provider, most commonly used to enumerate local group membership. This should also work for domain groups
Microsoft Lync: Group Policy Templates I’ve been migrating our Office Communications Server to Lync over the last few days. Last night I started looking at the client policies. The intention is that we use the in-band-provisioning, which
NetShell It’s been a while since I’ve posted, and since it’s almost Christmas I thought I’d better get on with it. Without further ado I want to post NetShell (I’
DnsShell: Zone and Server CmdLets After fixing a couple of authentication bugs with Set-DnsRecord and New-DnsRecord I decided to make an attempt to finish off some of the zone and server CmdLets. The module now contains these additional
DnsShell: Get-AD* A new version of DnsShell has been released, this release improves Get-ADDnsRecord and adds Get-ADDnsPartition and Get-ADDnsZone. The updated release is available on MSDN as version 0.2.0. code.msdn.microsoft.com/