Archive for the ‘Powershell’ Category

Dynamic and interactive filtering in Powershell

Filtering in Powershell are one of the most expressions i’m use for drill down get-cmdlet results. There are so much situations we would like to have some simple and clear technique to see the results in different views.   As an Example I will use get-process with three views:   SlowMotion (More about here.)  Startet Services  Stopped [...]

SHA1 Hash from a String

There is not that much to say. Attached is a Script that generates a SHA1 Hash from a String. Why for me? We have several Servers they are storing files in a specified format on different folders. I should write a Powershell Script who grab the content of each file and save the replace string back. For [...]

Exchange Format File has the wrong Signature

One week ago we deployed the Powershell Execution Policy AllSigned on our Servers.When i opened the Exchange Management Shell after that, the following red banner says “Hello” to me in Powershell. There were errors in loading the format data file:Microsoft.Exchange.Management.PowerShell.Admin, D:\Program Files\Microsoft Exchange\bin\Exchange.format.ps1xml : File skipped because of validation exception: “File D:\Program Files\Microsoft Exchange\bin\Exchange.format.ps1xml cannot be loaded. The [...]

Store Configurations in Powershell

Some Scripts need to store configuration values in Ini- or XML-Files. What is the best way to do that? Ini-Files Using Ini-Files in Powershell is a challenge. Microsoft Currently has no real Access Solution for Ini-Files. The Community give us some ways to use a workaround. Two other Methods are: Method 1: Google Groups Thread [...]

Quick Powershell Bundle for Intype

My Daily Work give me allot cases witch i can do with Powershell Scripts. So far i don’t know any Script-Editor who support highlighting for Powershell Syntax. It is possible that Intype become for me the next regular editor. I hope this bundle gives advantage to more script developers like me, but don’t expected to [...]

Diskusage in Powershell

Here is a small Snippet who shows you the Size of all Diskdrives in Powershell. It works also in remotly. function global:DiskUsage {     param([string]$servername = "localhost")       $pingresult=(Get-WmiObject -Class Win32_PingStatus -Filter "Address=’$servername’" -ComputerName . | select Statuscode)     if($pingresult.Statuscode -ne $null -and $pingresult.Statuscode -eq 0)     {         get-wmiobject Win32_LogicalDisk -computername $servername -filter [...]