Browse by Tags

Related Posts
  • Blog Post: PowerShell’s format operator

    I just came across a tip at the Hey, Scripting Guy! Blog about grouping numbers and controlling the decimal places after the dot, that describes the use of the ToString method of the number (int) object. Since I prefer using PowerShell’s -f format operator for that, and it’s description in the PowerShell...
  • Blog Post: Get and Set the machineKeys in machine.config

    In an ASP.NET web application, if you use ViewState, Session, Forms authentication, or other encrypted and/or secured values, these values are encrypted and decrypted using a set of keys called decryptionKey and validationKey located in the machineKey element under the system.web section in the .NET...
  • Blog Post: Get and Set the compilation debug flag in web.config

    Since the main technology I support as a PFE is IIS, I often find myself writing scripts for IIS or ASP.NET management. For example, one of the first things I check when troubleshooting ASP.NET applications is the debug flag in the web.config. For this, I’ve written the following two example functions...
  • Blog Post: PowerShell scripting best practices

    For the past few years, I’ve picked up a several best practices for PowerShell scripting. Some of them are “borrowed” from Ed Wilson (aka the Microsoft Scripting Guy ), Don Jones , and other PowerShell MVPs and PFEs @ Microsoft. Start your scripts with a standard set of comments (name, date, author,...
  • Blog Post: Dynamic ValidateSet in a Dynamic Parameter

    A colleague of mine needed a way to have a parameter accept only a specific set of paths. I told him this can be accomplished easily with the ValidateSet decoration on the parameter , but he then explained that what the actually needed, is to have the set dynamically defined by the sub folders in the...
  • Blog Post: Get Excel data without Excel

    In a specific scenario, I needed to be able to query an Excel file and get data from a worksheet but I didn’t (and couldn’t) have the Office suite (or even Excel only) installed on the machine. If the Excel file is and xlsx file (the new Microsoft Open XML Format since Excel 2007), you could extract...
  • Blog Post: Set the Windows 7 user account picture

    Not too long ago, I was asked if it's possible and how to set the Windows 7 user account picture (the one you see in the Start menu, and in the Lock screen) using PowerShell. There is no official documented way of doing it, but it can be accomplished quite easily using the SetUserTile static function...
  • Blog Post: Free PowerShell eBooks

    last update: 2014/08/12 This (frequently updated) post contains links to useful and free PowerShell eBooks. If you have a suggestion for an eBook to be added to the list, please add a comment at the bottom of this post. Windows PowerShell 1.0 TFM: http://www.sapien.com/blog/2009/12/01/free-windows-powershell...
  • Blog Post: Useful PowerShell Modules

    This (frequently updated) post contains links to useful PowerShell Modules. If you have a suggestion for a module to be added to the list, please add a comment at the bottom of this post. NTFS: Allows a much easier management of permissions on files and folders using PowerShell http://gallery.technet...
  • Blog Post: Write-Host “Hello World”

    Hello world. My name is Martin, and I’ve been working in the IT industry for over 15 years, last 3 at Microsoft as a Senior Premier Field Engineer . What does a Premier Field Engineer (PFE) do? Read all about it here . Anyway, in this blog, I’ll be posting PowerShell tips I collect from the field. Hence...