Category: PowerShell

PowerShell – How to execute PowerShell code before and after a given scriptblock

I hope the description was clear enough to understand what i mean 🙂 As a programmer or “scripter” you really want to copy/paste as less as possible and keep the code clean. This reduces the chance of failures/bugs and much more readable. For this reason you have to use functions when code is used more than […]

PowerShell – How to colorize a datatable or custom object with PowerShell

Unfortunatly I did not find a way to colorize a table without using Write-Host. This would be very awesome and would safe a lot of code. The problem with outputting tekst to the console with Write-Host is that you can’t use the automatic width of the columns. To fix that I calculated the width of […]

PowerShell – How to compare array with an other array using wildcards

If you want to find items in an array using a single string, you can use wildcards to match that item. Example:

PowerShell – Get RoboCopy Exit Codes

If you use RoboCopy in your PowerShell script, you might want to know if everything went well. Besides the log file, you can check the Exit Code as well.

PowerShell – Get Folder Size

If you need the size of an folder in MB’s. You can use below script to obtain this information. The $FolderSize variable will return the folder size in the following format: 77,84 MB

PowerShell – How to run Exchange powershell commands from a regular PowerShell window

What if you want to execute Exchange commands/Cmdlets from a script? Or you just hate the ugly Exchange management shell (like me) and want to use the regular (blue) PowerShell window?

PowerShell – How to check for open port without telnet!

What if you want to check for open ports on a server, but you don’t have telnet installed on your management server? Yes! Use PowerShell! But how?

PowerShell – How to create a .NET DataTable and save it to XML file

I use PowerShell a lot. Sometimes to automate something with a script but often just to get some data. Export my results to a csv (Export-CSV) for example not always gets the result you want. Create your own table and you are more in control export it to a XML file and your ready to […]

Custom answer file for New-RDVirtualDesktopCollection fails!

Hi there, Ever tried to create a Windows 8 VirtualDesktop collection (VDI) on Windows Server 2012 Remote Desktop Services? Yes? And did you try to add a custom answer file to it? With PowerShell? If you answered the questions above with yes you probably find out that it’s not gonna work out of the box and […]

Windows Server 2012 PowerShell Reference

Are you looking for some Windows Server 2012 PowerShell Cmdlets?

Page 1 of 212

About Me

My name is Bart Scheltinga and I live in the Netherlands. I work as a Senior Citrix Administrator for Conclusion FIT.

Certified:
MCSA Windows Server 2012
CCA-V: Managing Citrix XenDesktop 7 Solutions CCP-V: Deploying Citrix XenDesktop 7 Solutions

Ads

My Twitter Feed