background preloader

PowerShell Code Repository

PowerShell Code Repository

http://poshcode.org/

Related:  Powershell collectionPowershell

Ultimate PowerShell Prompt Customization and Git Setup Guide Source control and Git keeps getting more and more important for both Developers and Operations guys. Getting up and running with Git on MacOS or Linux is very easy as most things are built in. There are also cool tools like oh-my-zsh to customize your prompt. On Windows, it’s a bit of a different story. Let’s spend a little time installing ConEmu and Git, then customizing it to take our prompt from something that looks like this: Beyond Export-Csv: Export-Xls - LucD notes Warning: this post has no “virtual” content ! This time I post a function that allows you to export your data to a “real” spreadsheet (XLS format) instead of a CSV file. The reason for posting this function was a series of threads in the PowerCLI Community by Suresh. Over several threads he has been collecting scripts that create various reports on his vSphere environment. Ultimately he wanted to have a spreadsheet where each report would be stored on a worksheet. PowerShell has the very handy Export-Csv cmdlet to create CSV files but afaik nothing for creating XLS files

12 Most Useful Google Chrome Browser Commands To get to the Menu on Google Chrome browser, click on the “Wrench” icon on the top right-hand corner. From here you can access certain browser features. However, there are several features that are not available from the Menu, which you can access only using the commands. Some of the features are available under both Menu and commands.

Keyboard Shortcuts for the Windows PowerShell ISE Use the following keyboard shortcuts to perform actions in Windows PowerShell® Integrated Scripting Environment (ISE). Windows PowerShell ISE is available as part of the Windows Server and Windows client operating systems, but can also be installed on some older Windows operating systems as part of the Windows Management Framework 4.0 download package. Keyboard shortcuts for editing text You can use the following keyboard shortcuts when you edit text. Keyboard shortcuts for running scripts

Custom objects default display in PowerShell 3.0 April 13, 2012 In PowerShell 3.0 we can now create new custom objects using a hash table. PS> [PSCustomObject]@{ One = 1 Two = 2 Three = 3 Four = 4 Five = 5 } One : 1 Two : 2 Three : 3 Four : 4 Five : 5 Behind the scenes, PowerShell creates a hash table and wraps it a PSCustomObject. It is way faster than using the New-Object cmdlet and it also provides consistency, while maintaining backwards compatibility. Another benefit of using PSCustomObject over New-Object is property order.

Network/IPTables 1. Introduction CentOS has an extremely powerful firewall built in, commonly referred to as iptables, but more accurately is iptables/netfilter. Iptables is the userspace module, the bit that you, the user, interact with at the command line to enter firewall rules into predefined tables. Netfilter is a kernel module, built into the kernel, that actually does the filtering.

Speed Up Excel Automation with PowerShell - Hey, Scripting Guy! Blog Summary: Microsoft PFE, Georges Maheu, optimizes the Windows PowerShell script he presented yesterday. Microsoft Scripting Guy, Ed Wilson, is here. Our guest blogger today is Georges Maheu. Get-AD Verified on the following platforms This script is tested on these platforms by the author. It is likely to work on other platforms as well. If you try it and find that it works on another platform, please add a note to the script discussion to let others know. Create a Really Cool PowerShell ISE Profile Summary: Learn how to create a powerful Windows PowerShell ISE profile by running a single script. Microsoft Scripting Guy Ed Wilson here. One of the problems with writing a daily blog is that after a while, you end with a huge collection of articles and scripts. When I got a new laptop, and immediately left the country, I was really happy that I could access the Hey, Scripting Guy! Blog, and copy scripts so I could customize my Windows PowerShell ISE. Then I realized I had a problem: everything was cumulative, which meant that I spent hours and hours copying scripts, running scripts, and checking through dozens of Hey, Scripting Guy!

PowerShell One-Liners: Collections, Hashtables, Arrays and Strings The way to learn PowerShell is to browse and nibble, rather than to sit down to a formal five-course meal. In his continuing series on Powershell one-liners, Michael Sorens provides Fast Food for busy professionals who want results quickly and aren't too faddy. Part 3 has as its tasty confections Collections, Hashtables, arrays and strings.

Kernel Korner - Linux as an Ethernet Bridge Have you ever been asked to secure a router over which you did not have administrative control? What about when you are on a network you don't own but want to secure the segment are you using? A request similar to this one is what brought me to the wonderful world of Bridge, the Linux Ethernet bridging project. According to the Bridge Web site: Ethernet bridging is a way to connect networks together to form a larger network. The standard for bridging is ANSI/IEEE 802.1d. Microsoft Exchange 2010 PowerShell Cookbook (Review) [easyazon-image align="left" asin="1849682461" locale="us" height="110" src=" width="89"]PowerShell is hands down one of the most important skills than an Exchange administrator can learn. You can do a lot in Exchange Server 2010 using the GUI administration tools, but eventually you’re going to have to drop into the shell to do some deeper administration or simply to save time on bulk admin. My first contact with PowerShell was when Exchange Server 2007 was released.

Export and Import PowerShell ISE Opened Files - Windows PowerShell Blog Unlike other tools, PowerShell ISE doesn’t have project files. Project files are a good way to set your environment up with a well known state. Thanks to the ISE Object Model, it is possible to add some project functionality. The script below has two main functions “Export-ISEState” and “Import-ISEState”.

Create a Transcript of Commands from the Windows PowerShell ISE Summary: Create a transcript of commands from the Windows PowerShell ISE in this Microsoft Scripting Guys how-to article. Microsoft Scripting Guy Ed Wilson here. One of the things I enjoy about using the Windows PowerShell console is the transcript feature. When I am playing around on the Windows PowerShell console, experimenting, trying out new ideas, and exploring ideas, it is great not to worry about losing any cool code I discover.

Related: