PowerShell x64 vs x86: set execution policy when using Visual Studio post build events

Running PowerShell scripts in the Post build events within a Visual Studio project? Getting errors telling you “running scripts is disabled on this system”? While working on Office 365 Developer Patterns and Practices (PnP) solution OfficeDevPnP.PowerShell Commands I had troubles with building my solution. Visual Studio uses PowerShell x86 in the background instead of my... Continue Reading →

Developing hybrid SharePoint apps that run on-premise and in the cloud – ESPC 2014

My session at the European SharePoint Conference (#ESPC14) was around developing hybrid apps with the SharePoint App Model. Below you can find the slide deck and PowerShell scripts I used during the demo. Before you start building hybrid apps who are depending on the authentication done by Azure Control Services (ACS) you need to setup... Continue Reading →

Ping, nslookup and ipconfig cmd via PowerShell

I’m used to regularly work with ping.exe, nslookup.exe and ipconfig.exe in the command prompt. With PowerShell becoming more and more the default it’s time to change my default behavior, sounds like a real programmer… PowerShell 4.0 provides cmdlets for these commonly used command-line executables. Since I’m often searching for the cmdlet name, I thought to... Continue Reading →

Get disk storage for SharePoint databases

To get an indication for all database sizes in your SharePoint farm, run the following command. It shows the disk storage in bytes and MB. The PowerShell script used for the output above, can be found below. Add-PSSnapin Microsoft.SharePoint.PowerShell Get-SPDatabase | sort Name | ft Name, ` @{Name="DiskSizeRequired";Align='Right';Expression={[string]("{0:N0}" -f($_.DiskSizeRequired))}}, ` @{Name="Size(MB)";Align='Right';Expression={[string]("{0:N0}" -f($_.DiskSizeRequired/1mb))}}, ` Server -Autosize... Continue Reading →

In search of PowerShell environment variables

When working with PowerShell I’m searching for the same variables over and over again. Every time when I found them again I think the same “Oh yeah, I knew that!”. To minimize my search next time I thought about writing it down. First question, how do I use these variables? This is pretty straightforward. $Env:username... Continue Reading →

Create a website or blog at WordPress.com

Up ↑