<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I Love Powershell</title>
	<atom:link href="http://www.ilovepowershell.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ilovepowershell.com</link>
	<description>Foreach ($day in $life) {Learn-More}</description>
	<lastBuildDate>Sat, 14 Jan 2012 23:07:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How To Run Scripts With PowerShell</title>
		<link>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/</link>
		<comments>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 19:22:02 +0000</pubDate>
		<dc:creator>Michael Simmons - I Love Powershell</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Comment]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[profile]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/</guid>
		<description><![CDATA[If you’re new to PowerShell, some of the first things you’ll want to do are find your way around, find the commands, aliases.&#160; Some of the concepts, like figuring out the pipe, and how to use it, can be a struggle. Before long, though, you’re going to start getting used to it, and then you’ll [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re new to PowerShell, some of the first things you’ll want to do are find your way around, find the commands, aliases.&#160; Some of the concepts, like figuring out the pipe, and how to use it, can be a struggle.</p>
<p>Before long, though, you’re going to start getting used to it, and then you’ll want to start saving your work so you can reuse it.&#160; You can do that by saving a text file with a .ps1 extension.&#160; A ps1 is just a PowerShell script.&#160; You don’t have to have anything else in it other than the same commands you use when you’re typing in to the PowerShell console.&#160; In fact, anything that you can type into the console can be typed into a .ps1 file exactly the same way, and then run.</p>
<p>So this is for my PowerShell people that are just getting to know their way around, and need to start either working with PowerShell profiles or start running PS1 files.&#160; Once you’ve gotten the script doing what you want, you can also <a title="iLovePowerShell - How To Run a PowerShell Script as a Scheduled Task" href="http://www.ilovepowershell.com/how-to-run-powershell-script-as-scheduled-task/">run a PowerShell script as a scheduled task</a>.</p>
<p>Here are some things you can (and should) do to work with ps1 files, including your profile:</p>
<h3>Tip 1:&#160; Set the Execution Policy on One Machine (Use Group Policy for a Domain)</h3>
<p>PowerShell takes security seriously.&#160; By default, you cannot run scripts at all, not even your profile.&#160; The execution policy defines what scripts you can run.&#160; </p>
<p>There are four settings for the execution policy.&#160; You can set this to whatever you like, but it may have already been set for you in your environment via group policy.&#160; Here are the different settings you can set the execution policy to, from most restrictive to least</p>
<p>An execution policy is applied to a scope.&#160; There are three scopes you can apply the policy setting to:&#160; LocalMachine (the computer), CurrentUser (the user), or Process (the currently running PowerShell session and the policy goes away once the window is closed.)&#160; If you don’t specify a scope, you’re setting the LocalMachine policy.&#160; Also, there is a preference in applying scopes:&#160; Process overrides CurrentUser, which in turn overrides LocalMachine.</p>
<ul>
<li>Undefined – If all scopes are undefined then it is set to the default, which is restricted. </li>
<li>Restricted – No scripts may run at all. </li>
<li>AllSigned – All scripts that have a digital signature may run. </li>
<li>RemoteSigned – Local scripts may run.&#160; Scripts executed from the network must be digitally signed. </li>
<li>Unrestricted – All scripts may run. </li>
<li>Bypass – All scripts may run, and all warnings and prompts are disabled. </li>
</ul>
<p>Which execution policy you set is up to you.&#160; Usually a prudent choice is RemoteSigned.&#160; Here’s how you set it</p>
<blockquote><p>Set-ExecutionPolicy&#160; RemoteSigned</p>
</blockquote>
<p>Easy, right?&#160; Well without setting the execution policy, all of your scripts, even your own profile, won’t run at all.</p>
<h3>Tip 2: Save Work You Will Use Again in a Script</h3>
<p>If you’re not already using the Integrated Scripting Environment (ISE), you should really get to know it.</p>
<p>When you go to start PowerShell, instead look for the option to start PowerShell ISE.&#160; Using the ISE gives you an opportunity to save the work that you’ve been doing often, and you can run bits and pieces of your script as you’re writing it to make sure it’s working as you intend.</p>
<h3>Tip 3: Use a PowerShell Profile</h3>
<p>If you are starting to get into writing down the things you do, you should look at creating a profile.&#160; The profiles (there are multiples actually) are very useful for defining functions, mapping PSDrives, and importing modules.&#160; If you haven’t setup your profile yet, I’ve written a post outlining <a title="iLovePowerShell.com - How To Create a PowerShell Profile" href="http://www.ilovepowershell.com/how-to-create-a-powershell-profile/">how to setup your PowerShell profile</a></p>
<h3>Tip 4: Use Comments, Even For Scripts Only You Will Use</h3>
<p>When typing out your scripts into a ps1 file, it’s a great idea to use comments liberally.&#160; Even if you think you will not be sharing this script with others, you will likely be sharing it with yourself 6 months after you wrote it.&#160; The things that you thought would always be obvious suddenly are not.&#160; You can save yourself a lot of frustration and time decoding your own scripts if you just add some comments throughout the script describing what you’re attempting to do with it.</p>
<p>The comment character for PowerShell is the Number Sign (Pound Sign, or #).&#160; Anything written after a # in a PowerShell script file (ps1), or even in the console, are not processed but instead passed over.&#160; </p>
<p>You can easily comment out a single line of your script by placing a “#” at the beginning of it, like this:</p>
<blockquote><p># Write-Host “This Line is a comment.&#160; It won’t write anything”     <br /># This is a comment too.&#160; </p>
<p># Comments can be used at the end of a single line to describe what is happening </p>
<p>$myVariable = 2 + 4&#160;&#160;&#160; # This should set $myVariable to 6.</p>
</blockquote>
<p>You can also comment with a comment block.&#160; Anything written (even on multiple lines) is commented out.&#160; A comment block starts with &lt;#, and then anything after that is a comment until the comment block ends with a #&gt;</p>
<blockquote><p>&lt;# This is a comment block</p>
<p>Still a comment</p>
<p>This is the last comment line #&gt;</p>
<p>Write-host “Uncommented now”</p>
</blockquote>
<p>I hope this is a help to those of you just starting out with PowerShell, and that it helps move you from just starting out, to taking the next steps towards automating with Windows PowerShell.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/how-to-run-scripts-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Find Which Cmdlets Have No Alias</title>
		<link>http://www.ilovepowershell.com/how-to-find-cmdlets-with-no-alias/</link>
		<comments>http://www.ilovepowershell.com/how-to-find-cmdlets-with-no-alias/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 21:37:09 +0000</pubDate>
		<dc:creator>Michael Simmons - I Love Powershell</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Alias]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/how-to-find-cmdlets-with-no-alias/</guid>
		<description><![CDATA[Finding cmdlets that already have aliases is really easy.&#160; You can use the Get-Alias cmdlet to find them. gal &#124; select definition –unique # “Gal” is an alias for Get-Alias. “Select” is an alias for Select-Object&#160; If you want to speed up your time at the console, you should consider finding ways to type less.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Finding cmdlets that already have aliases is really easy.&#160; You can use the Get-Alias cmdlet to find them.</p>
<blockquote><p>gal | select definition –unique</p>
<p># “Gal” is an <a href="http://www.ilovepowershell.com/list-of-aliases">alias</a> for Get-Alias. “Select” is an alias for Select-Object&#160; </p>
</blockquote>
<p>If you want to speed up your time at the console, you should consider finding ways to type less.&#160; That can be done by creating aliases.&#160; There are already a lot of aliases, but here’s how to find all the cmdlets that do not yet have an alias.</p>
<p><span id="more-124"></span><br />
<blockquote>
<p>Get-Command –commandtype cmdlet | Where-Object { !(Get-Alias –Definition $_.name –erroraction silentlycontinue) }</p>
</blockquote>
<blockquote><p># or, the same thing using aliases</p>
<p>gcm –commandtype cmdlet | ? { !(gal –definition $_.name –ea silentlycontinue)}</p>
</blockquote>
<p>If you store the results in an array called $noAlias we can easily do things like “find how many cmdlets have no alias”</p>
<blockquote><p>$noAlias.length      <br />133</p>
</blockquote>
<p>That’s 133 cmdlets with no alias.&#160; Ripe for the picking. How about the 3 cmdlets with no alias that are the longest to type?&#160; Here they are:</p>
<blockquote><p>$noAlias | sort –des {$_.name.length} | select name –first 3</p>
<p>Name      <br />&#8212;-       <br />Unregister-PSSessionConfiguration       <br />Register-PSSessionConfiguration       <br />Disable-PSSessionConfiguration</p>
</blockquote>
<p>Or instead of the longest names, here are the types of objects to perform actions on (the nouns) that may benefit from having more aliases.</p>
<blockquote><p>$noAlias | group noun | sort –des count | select count, name –first 5</p>
<p>Count Name      <br />&#8212;&#8211; &#8212;-       <br />&#160;&#160;&#160; 7 EventLog       <br />&#160;&#160;&#160; 6 PSSessionConfiguration       <br />&#160;&#160;&#160; 6 Computer       <br />&#160;&#160;&#160; 5 Transaction       <br />&#160;&#160;&#160; 5 Event</p>
</blockquote>
<p>So there you have it.&#160; You now can see lots of places where you can further streamline your console commands by creating aliases for cmdlets that don’t have them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/how-to-find-cmdlets-with-no-alias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create a PowerShell Alias</title>
		<link>http://www.ilovepowershell.com/how-to-create-a-powershell-alias/</link>
		<comments>http://www.ilovepowershell.com/how-to-create-a-powershell-alias/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 20:57:52 +0000</pubDate>
		<dc:creator>Michael Simmons - I Love Powershell</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Alias]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/?p=123</guid>
		<description><![CDATA[When you use a command often, you may want to be able to access that PowerShell cmdlet more quickly from the console.&#160; There are many aliases that PowerShell recognizes by default, but if you want to create your own, you can save yourself a lot of keystrokes. FIND OUT:&#160; Which Cmdlet’s Don’t Have An Alias [...]]]></description>
			<content:encoded><![CDATA[<p>When you use a command often, you may want to be able to access that PowerShell cmdlet more quickly from the console.&#160; There are many <a title="List of Default PowerShell Aliases" href="http://www.ilovepowershell.com/list-of-top-powershell-alias/">aliases that PowerShell recognizes by default</a>, but if you want to create your own, you can save yourself a lot of keystrokes.</p>
<p><span id="more-123"></span>
<p align="center"><strong><a title="How To Find Cmdlets With No Alias For Them" href="http://www.ilovepowershell.com/how-to-find-cmdlets-with-no-alias/">FIND OUT:&#160; Which Cmdlet’s Don’t Have An Alias Already?</a></strong></p>
<p>&#160;</p>
<p>When you’re ready to make an alias, it’s really easy to add it.&#160; But you might want to consider some of the common conventions in use for aliases if you’re going to keep your alias in use for multiple sessions.</p>
<h3>Get To Know The New-Alias Cmdlet:</h3>
<p>The New-Alias cmdlet takes these parameters</p>
<table border="0" cellspacing="0" cellpadding="2" width="895">
<tbody>
<tr>
<td valign="top" width="77">Parameter Name</td>
<td valign="top" width="73">Position</td>
<td valign="top" width="70">Required</td>
<td valign="top" width="67">Default</td>
<td valign="top" width="133">Accept Pipeline</td>
<td valign="top" width="473">What it does</td>
</tr>
<tr>
<td valign="top" width="77">Name</td>
<td valign="top" width="73">1</td>
<td valign="top" width="70">Yes</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">By PropertyName</td>
<td valign="top" width="473">This is what you’ll type to call the alias. </td>
</tr>
<tr>
<td valign="top" width="77">Value</td>
<td valign="top" width="73">2</td>
<td valign="top" width="70">Yes</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">By PropertyName</td>
<td valign="top" width="473">This is the result of the alias – the command that it’s calling</td>
</tr>
<tr>
<td valign="top" width="77">Description</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">A description of the alias</td>
</tr>
<tr>
<td valign="top" width="77">Force (switch)</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">If the alias already exists, it makes this command update (change) the existing alias</td>
</tr>
<tr>
<td valign="top" width="77">Option</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">None</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">You can choose <strong>None </strong>(default), <strong>ReadOnly </strong>(can’t be changed except with “force”), <strong>Constant </strong>(can’t be changed at all), <strong>Private </strong>(can only be seen in the scope listed by the “scope” parameter)</td>
</tr>
<tr>
<td valign="top" width="77">Scope</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">You can set the scope to be <strong>Global</strong> (all parts of the session), <strong>Local</strong> (The current part of the session), or <strong>Script</strong> (all parts of the current script)</td>
</tr>
<tr>
<td valign="top" width="77">Passthru (switch)</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">When the new alias command is run, the alias is returned.&#160; Passthru allows the results (the alias object) to be passed through the pipeline.</td>
</tr>
<tr>
<td valign="top" width="77">Confirm          <br />(switch)</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">Prompt for confirmation before creating the alias.</td>
</tr>
<tr>
<td valign="top" width="77">WhatIf (switch)</td>
<td valign="top" width="73">Named</td>
<td valign="top" width="70">No</td>
<td valign="top" width="69">&#160;</td>
<td valign="top" width="133">No</td>
<td valign="top" width="473">Doesn’t create the alias, just tells what would happen if it tried to create the alias</td>
</tr>
</tbody>
</table>
<p>Notice that there are two required parameters: Name and Value.&#160; All we have to do to create an alias is populate those:</p>
<blockquote><p>New-Alias –name ip –value ipconfig</p>
</blockquote>
<p>But there is still an easier way.</p>
<h3>Creating an Alias in PowerShell with Shortcuts</h3>
<p>First, there is an alias for the New-Alias cmdlet:&#160; “nal”</p>
<p>Second, the required “name” and “value” are positional, which means they don’t have to be named.&#160; They can be assigned to the right parameter by putting them in their correct order.&#160; This makes creating our alias even easier:</p>
<blockquote><p>nal ip ipconfig</p>
</blockquote>
<h3>Save Your Aliases Between PowerShell Sessions</h3>
<p>If you want to save your aliases, you’ve got two options: Either write the alias into your profile, or export the aliases using Export-Alias.</p>
<p>In situations like an I.T. department wants to all use the same custom aliases, or you’ve got want to use the same custom aliases on all of your machines, you should export the aliases.</p>
<p>Either way, you will need to <a title="I Love PowerShell - How To Create A PowerShell Profile" href="http://www.ilovepowershell.com/how-to-create-a-powershell-profile/">create a profile</a> before you can either define aliases or import them into new sessions</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/how-to-create-a-powershell-alias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of Aliases Used in PowerShell</title>
		<link>http://www.ilovepowershell.com/list-of-top-powershell-alias/</link>
		<comments>http://www.ilovepowershell.com/list-of-top-powershell-alias/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 21:10:43 +0000</pubDate>
		<dc:creator>Michael Simmons - I Love Powershell</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Alias]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Learning PowerShell]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/list-of-top-powershell-alias/</guid>
		<description><![CDATA[Here’s a list of aliases you can use for PowerShell.&#160; An alias is just a shortcut.&#160; You can use an alias from the console or in a script, and it works just the same as the command that it references. These are the default aliases that come with PowerShell version 2.&#160; You can add to [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s a list of aliases you can use for PowerShell.&#160; An alias is just a shortcut.&#160; You can use an alias from the console or in a script, and it works just the same as the command that it references.</p>
<p>These are the default aliases that come with PowerShell version 2.&#160; You can add to this list by creating your own alias. </p>
<p><span id="more-120"></span>
<p>&#160;</p>
<p>
<table border="0" cellspacing="0" cellpadding="2" width="373">
<tbody>
<tr>
<td valign="top" width="178">
<h3><u>Name</u></h3>
</td>
<td valign="top" width="193">
<h3><u>Definition</u></h3>
</td>
</tr>
<tr>
<td valign="top" width="192">%</td>
<td valign="top" width="200">Foreach-Object</td>
</tr>
<tr>
<td valign="top" width="195">?</td>
<td valign="top" width="203">Where-Object</td>
</tr>
<tr>
<td valign="top" width="194">ac </td>
<td valign="top" width="205">Add-Content </td>
</tr>
<tr>
<td valign="top" width="193">asnp </td>
<td valign="top" width="206">Add-PSSnapIn </td>
</tr>
<tr>
<td valign="top" width="192">cat </td>
<td valign="top" width="207">Get-Content </td>
</tr>
<tr>
<td valign="top" width="192">cd </td>
<td valign="top" width="207">Set-Location </td>
</tr>
<tr>
<td valign="top" width="192">chdir </td>
<td valign="top" width="207">Set-Location </td>
</tr>
<tr>
<td valign="top" width="192">clc </td>
<td valign="top" width="207">Clear-Content </td>
</tr>
<tr>
<td valign="top" width="192">clear </td>
<td valign="top" width="207">Clear-Host </td>
</tr>
<tr>
<td valign="top" width="192">clhy </td>
<td valign="top" width="207">Clear-History </td>
</tr>
<tr>
<td valign="top" width="192">cli </td>
<td valign="top" width="207">Clear-Item </td>
</tr>
<tr>
<td valign="top" width="192">clp </td>
<td valign="top" width="207">Clear-ItemProperty </td>
</tr>
<tr>
<td valign="top" width="192">cls </td>
<td valign="top" width="207">Clear-Host </td>
</tr>
<tr>
<td valign="top" width="192">clv </td>
<td valign="top" width="207">Clear-Variable </td>
</tr>
<tr>
<td valign="top" width="192">compare </td>
<td valign="top" width="207">Compare-Object </td>
</tr>
<tr>
<td valign="top" width="192">copy </td>
<td valign="top" width="207">Copy-Item </td>
</tr>
<tr>
<td valign="top" width="192">cp </td>
<td valign="top" width="207">Copy-Item </td>
</tr>
<tr>
<td valign="top" width="192">cpi </td>
<td valign="top" width="207">Copy-Item </td>
</tr>
<tr>
<td valign="top" width="192">cpp </td>
<td valign="top" width="207">Copy-ItemProperty </td>
</tr>
<tr>
<td valign="top" width="192">cvpa </td>
<td valign="top" width="207">Convert-Path </td>
</tr>
<tr>
<td valign="top" width="192">dbp </td>
<td valign="top" width="207">Disable-PSBreakpoint </td>
</tr>
<tr>
<td valign="top" width="192">del </td>
<td valign="top" width="207">Remove-Item </td>
</tr>
<tr>
<td valign="top" width="192">diff </td>
<td valign="top" width="207">Compare-Object </td>
</tr>
<tr>
<td valign="top" width="192">dir </td>
<td valign="top" width="207">Get-ChildItem </td>
</tr>
<tr>
<td valign="top" width="192">ebp </td>
<td valign="top" width="207">Enable-PSBreakpoint </td>
</tr>
<tr>
<td valign="top" width="192">echo </td>
<td valign="top" width="207">Write-Output </td>
</tr>
<tr>
<td valign="top" width="192">epal </td>
<td valign="top" width="207">Export-Alias </td>
</tr>
<tr>
<td valign="top" width="192">epcsv </td>
<td valign="top" width="207">Export-Csv </td>
</tr>
<tr>
<td valign="top" width="192">epsn </td>
<td valign="top" width="207">Export-PSSession </td>
</tr>
<tr>
<td valign="top" width="192">erase </td>
<td valign="top" width="207">Remove-Item </td>
</tr>
<tr>
<td valign="top" width="192">etsn </td>
<td valign="top" width="207">Enter-PSSession </td>
</tr>
<tr>
<td valign="top" width="192">exsn </td>
<td valign="top" width="207">Exit-PSSession </td>
</tr>
<tr>
<td valign="top" width="192">fc</td>
<td valign="top" width="207">Format-Custom</td>
</tr>
<tr>
<td valign="top" width="192">fl</td>
<td valign="top" width="207">Format-List</td>
</tr>
<tr>
<td valign="top" width="192">foreach</td>
<td valign="top" width="207">Foreach-Object</td>
</tr>
<tr>
<td valign="top" width="192">ft</td>
<td valign="top" width="207">Format-Table</td>
</tr>
<tr>
<td valign="top" width="192">fw </td>
<td valign="top" width="207">Format-Wide </td>
</tr>
<tr>
<td valign="top" width="192">gal </td>
<td valign="top" width="207">Get-Alias </td>
</tr>
<tr>
<td valign="top" width="192">gbp </td>
<td valign="top" width="207">Get-PSBreakpoint </td>
</tr>
<tr>
<td valign="top" width="192">gc</td>
<td valign="top" width="207">Get-Content</td>
</tr>
<tr>
<td valign="top" width="192">gci</td>
<td valign="top" width="207">Get-ChildItem</td>
</tr>
<tr>
<td valign="top" width="192">gcm</td>
<td valign="top" width="207">Get-Command</td>
</tr>
<tr>
<td valign="top" width="192">gcs</td>
<td valign="top" width="207">Get-PSCallStack</td>
</tr>
<tr>
<td valign="top" width="192">gdr</td>
<td valign="top" width="207">Get-PSDrive</td>
</tr>
<tr>
<td valign="top" width="192">ghy</td>
<td valign="top" width="207">Get-History</td>
</tr>
<tr>
<td valign="top" width="192">gi</td>
<td valign="top" width="207">Get-Item</td>
</tr>
<tr>
<td valign="top" width="192">gjb</td>
<td valign="top" width="207">Get-Job</td>
</tr>
<tr>
<td valign="top" width="192">gl</td>
<td valign="top" width="207">Get-Location</td>
</tr>
<tr>
<td valign="top" width="192">gm</td>
<td valign="top" width="207">Get-Member</td>
</tr>
<tr>
<td valign="top" width="192">gmo</td>
<td valign="top" width="207">Get-Module</td>
</tr>
<tr>
<td valign="top" width="192">gp</td>
<td valign="top" width="207">Get-ItemProperty</td>
</tr>
<tr>
<td valign="top" width="192">gps</td>
<td valign="top" width="207">Get-Process</td>
</tr>
<tr>
<td valign="top" width="192">group</td>
<td valign="top" width="207">Group-Object</td>
</tr>
<tr>
<td valign="top" width="192">gsn</td>
<td valign="top" width="207">Get-PSSession</td>
</tr>
<tr>
<td valign="top" width="192">gsnp</td>
<td valign="top" width="207">Get-PSSnapIn</td>
</tr>
<tr>
<td valign="top" width="192">gsv</td>
<td valign="top" width="207">Get-Service</td>
</tr>
<tr>
<td valign="top" width="192">gu</td>
<td valign="top" width="207">Get-Unique</td>
</tr>
<tr>
<td valign="top" width="192">gv</td>
<td valign="top" width="207">Get-Variable</td>
</tr>
<tr>
<td valign="top" width="192">gwmi</td>
<td valign="top" width="207">Get-WmiObject</td>
</tr>
<tr>
<td valign="top" width="192">h</td>
<td valign="top" width="207">Get-History</td>
</tr>
<tr>
<td valign="top" width="192">history</td>
<td valign="top" width="207">Get-History</td>
</tr>
<tr>
<td valign="top" width="192">icm</td>
<td valign="top" width="207">Invoke-Command</td>
</tr>
<tr>
<td valign="top" width="192">iex</td>
<td valign="top" width="207">Invoke-Expression</td>
</tr>
<tr>
<td valign="top" width="192">ih</td>
<td valign="top" width="207">Invoke-History</td>
</tr>
<tr>
<td valign="top" width="192">ii</td>
<td valign="top" width="207">Invoke-Item</td>
</tr>
<tr>
<td valign="top" width="192">ipal</td>
<td valign="top" width="207">Import-Alias</td>
</tr>
<tr>
<td valign="top" width="192">ipcsv</td>
<td valign="top" width="207">Import-Csv</td>
</tr>
<tr>
<td valign="top" width="192">ipmo </td>
<td valign="top" width="207">Import-Module </td>
</tr>
<tr>
<td valign="top" width="192">ipsn</td>
<td valign="top" width="207">Import-PSSession</td>
</tr>
<tr>
<td valign="top" width="192">ise</td>
<td valign="top" width="207">powershell_ise.exe</td>
</tr>
<tr>
<td valign="top" width="192">iwmi</td>
<td valign="top" width="207">Invoke-WMIMethod</td>
</tr>
<tr>
<td valign="top" width="192">kill</td>
<td valign="top" width="207">Stop-Process</td>
</tr>
<tr>
<td valign="top" width="192">lp</td>
<td valign="top" width="207">Out-Printer</td>
</tr>
<tr>
<td valign="top" width="192">ls</td>
<td valign="top" width="207">Get-ChildItem</td>
</tr>
<tr>
<td valign="top" width="192">man</td>
<td valign="top" width="207">help</td>
</tr>
<tr>
<td valign="top" width="192">md</td>
<td valign="top" width="207">mkdir</td>
</tr>
<tr>
<td valign="top" width="192">measure</td>
<td valign="top" width="207">Measure-Object</td>
</tr>
<tr>
<td valign="top" width="192">mi</td>
<td valign="top" width="207">Move-Item</td>
</tr>
<tr>
<td valign="top" width="192">mount</td>
<td valign="top" width="207">New-PSDrive</td>
</tr>
<tr>
<td valign="top" width="192">move</td>
<td valign="top" width="207">Move-Item</td>
</tr>
<tr>
<td valign="top" width="192">mp</td>
<td valign="top" width="207">Move-ItemProperty</td>
</tr>
<tr>
<td valign="top" width="192">mv</td>
<td valign="top" width="207">Move-Item</td>
</tr>
<tr>
<td valign="top" width="192">nal</td>
<td valign="top" width="207">New-Alias</td>
</tr>
<tr>
<td valign="top" width="192">ndr</td>
<td valign="top" width="207">New-PSDrive</td>
</tr>
<tr>
<td valign="top" width="192">ni</td>
<td valign="top" width="207">New-Item</td>
</tr>
<tr>
<td valign="top" width="192">nmo</td>
<td valign="top" width="207">New-Module</td>
</tr>
<tr>
<td valign="top" width="192">nsn</td>
<td valign="top" width="207">New-PSSession</td>
</tr>
<tr>
<td valign="top" width="192">nv</td>
<td valign="top" width="207">New-Variable</td>
</tr>
<tr>
<td valign="top" width="192">ogv</td>
<td valign="top" width="207">Out-GridView</td>
</tr>
<tr>
<td valign="top" width="192">oh</td>
<td valign="top" width="207">Out-Host</td>
</tr>
<tr>
<td valign="top" width="192">popd</td>
<td valign="top" width="207">Pop-Location</td>
</tr>
<tr>
<td valign="top" width="192">ps</td>
<td valign="top" width="207">Get-Process</td>
</tr>
<tr>
<td valign="top" width="192">pushd</td>
<td valign="top" width="207">Push-Location</td>
</tr>
<tr>
<td valign="top" width="192">pwd</td>
<td valign="top" width="207">Get-Location</td>
</tr>
<tr>
<td valign="top" width="192">r</td>
<td valign="top" width="207">Invoke-History</td>
</tr>
<tr>
<td valign="top" width="192">rbp</td>
<td valign="top" width="207">Remove-Breakpoint</td>
</tr>
<tr>
<td valign="top" width="192">rcjb</td>
<td valign="top" width="207">Receive-Job</td>
</tr>
<tr>
<td valign="top" width="192">rd</td>
<td valign="top" width="207">Remove-Item</td>
</tr>
<tr>
<td valign="top" width="192">rdr</td>
<td valign="top" width="207">Remove-PSDrive</td>
</tr>
<tr>
<td valign="top" width="192">ren</td>
<td valign="top" width="207">Rename-Item</td>
</tr>
<tr>
<td valign="top" width="192">rjb</td>
<td valign="top" width="207">Remove-Job</td>
</tr>
<tr>
<td valign="top" width="192">rm</td>
<td valign="top" width="207">Remove-Item</td>
</tr>
<tr>
<td valign="top" width="192">rmdir</td>
<td valign="top" width="207">Remove-Item</td>
</tr>
<tr>
<td valign="top" width="192">rmo</td>
<td valign="top" width="207">Remove-Module</td>
</tr>
<tr>
<td valign="top" width="192">rni</td>
<td valign="top" width="207">Rename-Item</td>
</tr>
<tr>
<td valign="top" width="192">rnp</td>
<td valign="top" width="207">Rename-ItemProperty</td>
</tr>
<tr>
<td valign="top" width="192">rp</td>
<td valign="top" width="207">Remove-ItemProperty</td>
</tr>
<tr>
<td valign="top" width="192">rsn</td>
<td valign="top" width="207">Remove-PSSession</td>
</tr>
<tr>
<td valign="top" width="192">rsnp</td>
<td valign="top" width="207">Remove-PSSnapin</td>
</tr>
<tr>
<td valign="top" width="192">rv</td>
<td valign="top" width="207">Remove-Variable</td>
</tr>
<tr>
<td valign="top" width="192">rvpa</td>
<td valign="top" width="207">Resolve-Path</td>
</tr>
<tr>
<td valign="top" width="192">rwmi</td>
<td valign="top" width="207">Remove-WMIObject</td>
</tr>
<tr>
<td valign="top" width="192">sajb</td>
<td valign="top" width="207">Start-Job</td>
</tr>
<tr>
<td valign="top" width="192">sal</td>
<td valign="top" width="207">Set-Alias</td>
</tr>
<tr>
<td valign="top" width="192">saps</td>
<td valign="top" width="207">Start-Process</td>
</tr>
<tr>
<td valign="top" width="192">sasv</td>
<td valign="top" width="207">Start-Service</td>
</tr>
<tr>
<td valign="top" width="192">sbp</td>
<td valign="top" width="207">Set-PSBreakpoint</td>
</tr>
<tr>
<td valign="top" width="192">sc</td>
<td valign="top" width="207">Set-Content</td>
</tr>
<tr>
<td valign="top" width="192">select</td>
<td valign="top" width="207">Select-Object</td>
</tr>
<tr>
<td valign="top" width="192">set</td>
<td valign="top" width="207">Set-Variable</td>
</tr>
<tr>
<td valign="top" width="192">si</td>
<td valign="top" width="207">Set-Item</td>
</tr>
<tr>
<td valign="top" width="192">sl</td>
<td valign="top" width="207">Set-Location</td>
</tr>
<tr>
<td valign="top" width="192">sleep</td>
<td valign="top" width="207">Start-Sleep</td>
</tr>
<tr>
<td valign="top" width="192">sort</td>
<td valign="top" width="207">Sort-Object</td>
</tr>
<tr>
<td valign="top" width="192">sp</td>
<td valign="top" width="207">Set-Property</td>
</tr>
<tr>
<td valign="top" width="192">spcb</td>
<td valign="top" width="207">Stop-Job</td>
</tr>
<tr>
<td valign="top" width="192">spps</td>
<td valign="top" width="207">Stop-Process</td>
</tr>
<tr>
<td valign="top" width="192">spsv</td>
<td valign="top" width="207">Stop-Service</td>
</tr>
<tr>
<td valign="top" width="192">start</td>
<td valign="top" width="207">Start-Process</td>
</tr>
<tr>
<td valign="top" width="192">sv</td>
<td valign="top" width="207">Set-Variable</td>
</tr>
<tr>
<td valign="top" width="192">swmi</td>
<td valign="top" width="207">Set-WMIInstance</td>
</tr>
<tr>
<td valign="top" width="192">tee</td>
<td valign="top" width="207">Tee-Object</td>
</tr>
<tr>
<td valign="top" width="192">type</td>
<td valign="top" width="207">Get-Content</td>
</tr>
<tr>
<td valign="top" width="192">where</td>
<td valign="top" width="207">Where-Object</td>
</tr>
<tr>
<td valign="top" width="192">wjb</td>
<td valign="top" width="207">Wait-Job</td>
</tr>
<tr>
<td valign="top" width="192">write</td>
<td valign="top" width="207">Write-Output</td>
</tr>
</tbody>
</table>
<p>&#160;</p>
<p>If you’ve not started streamlining your typing at the console by using these PowerShell aliases, you can get more done per keystroke.&#160; </p>
<p>A good thing to keep in mind is that while aliases can help a lot by letting you get your commands and pipelines completed quicker, aliases are not as easy to read.&#160;&#160; So us aliases as much as you can when you’re typing at the PowerShell console, but if you’re writing a function, script, or module (or a blog post) you’re doing your readers a favor by using the complete command names.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/list-of-top-powershell-alias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Update Configuration Manager Site Code With PowerShell</title>
		<link>http://www.ilovepowershell.com/set-sccm-site-code-with-powershell/</link>
		<comments>http://www.ilovepowershell.com/set-sccm-site-code-with-powershell/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 05:00:00 +0000</pubDate>
		<dc:creator>ILovePowershell</dc:creator>
				<category><![CDATA[OneLiner]]></category>
		<category><![CDATA[SCCM]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[Com Object]]></category>
		<category><![CDATA[Configuration Manager]]></category>
		<category><![CDATA[One Liner]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/set-sccm-site-code-with-powershell/</guid>
		<description><![CDATA[Did you move domains recently or reconfigure your System Center Configuration Manager (SCCM)?&#160; Maybe you’ve found your Config Manager site code broken.&#160; Here’s a one-liner that shows you How to update a sitecode for SCCM with PowerShell. &#160; This assumes that you’ve got SCCM running, and installed on the client.&#160; I found this problem hanging [...]]]></description>
			<content:encoded><![CDATA[<p>Did you move domains recently or reconfigure your System Center Configuration Manager (SCCM)?&#160; Maybe you’ve found your Config Manager site code broken.&#160; Here’s a one-liner that shows you <strong>How to update a sitecode for SCCM with PowerShell.</strong></p>
<p>&#160;</p>
<p>This assumes that you’ve got SCCM running, and installed on the client.&#160; I found this problem hanging around on our machines after a migration from an old domain into the new domain.&#160; Each domain had <a title="Microsoft System Center Homepage" href="http://www.microsoft.com/systemcenter/en/us/default.aspx" target="_blank">Microsoft Configuration Manager</a> installed on it, and each domain had a different site code.&#160; A domain wide group policy was used to install the client in each domain, but I had problems with <strong>the site code for the old domain still on the Configuration Manager client after domain migration </strong>was complete.</p>
<p>&#160;</p>
<p>Luckily, we can use PowerShell to change the site code, and we can even <strong>use PowerShell to discover published site codes.</strong>&#160; </p>
<p>&#160;</p>
<p>First we need to grab hold of our SMS client.&#160; In PowerShell, it couldn’t be easier:</p>
<blockquote><p>$sms = new-object –comobject “Microsoft.SMS.Client”</p>
</blockquote>
<p>We can use the methods of the <a title="SmsClient Client COM Automation Class" href="http://msdn.microsoft.com/en-us/library/cc146339.aspx" target="_blank">Microsoft.SMS.Client</a> class by using PowerShell to directly work with the SMS client object:</p>
<blockquote><p>$sms.SetAssignedSite(“ABC”)</p>
</blockquote>
<p>or find out what the site code is currently set to:</p>
<blockquote><p>$sms.GetAssignedSite()&#160;&#160;&#160;&#160;&#160;&#160; # This returns a string value</p>
</blockquote>
<p>Since the GetAssignedSite() method returns a string, it can be used in scripts to verify the site code is correct.&#160; I use this on scripts (pushed via Group Policy on the domain roots) to verify the site code is correct, and correct the site code automatically if it is wrong.</p>
<p>Since I know the site code, let’s say “ABC” is the new domain and “XYZ” is the old domain, I would use this:</p>
<blockquote><p>$sms = new-object –comobject “Microsoft.SMS.Client”</p>
<p>if ($sms.GetAssignedSite() –ne “ABC”) { $sms.SetAssignedSite(“ABC”) }</p>
</blockquote>
<p>Finally, I’ll call attention to another method of the SMS Client object:&#160; AutoDiscoverSite()</p>
<p>AutoDiscoverSite returns a site code for the Active Directory Domain (if published)</p>
<blockquote><p>$sms = new-object –comobject “Microsoft.SMS.Client”</p>
<p>if ($sms.GetAssignedSite() –ne $sms.AutoDiscoverSite() ) { $sms.SetAssignedSite($sms.AutoDiscoverSite()) } </p>
</blockquote>
<p>Now just a little clean up here…</p>
<blockquote><p>Write-host “Thanks for reading.&#160; <a title="Subscribe to the iLovePowerShell blog" href="http://www.iLovePowerShell.com/rss" target="_blank">Subscribe</a>! Or, connect via <a title="Connect with Michael_Simmons on Twitter." href="http://www.twitter.com/Michael_Simmons" target="_blank">Twitter</a>&#160; or <a title="Friend on Facebook" href="http://www.facebook.com/Michael.simmons1" target="_blank">Facebook</a>.&#160; Ask questions to twitter using #poshhelp or #powershell to get q’s answered fast!”</p>
<p>$null = $thisBlogPost</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/set-sccm-site-code-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frequently Used PowerShell Oneliner(s) &#8211; Kill All Internet Explorer Windows</title>
		<link>http://www.ilovepowershell.com/oneliner-how-to-kill-all-internet-explorer-processes/</link>
		<comments>http://www.ilovepowershell.com/oneliner-how-to-kill-all-internet-explorer-processes/#comments</comments>
		<pubDate>Mon, 27 Dec 2010 13:00:00 +0000</pubDate>
		<dc:creator>ILovePowershell</dc:creator>
				<category><![CDATA[OneLiner]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://www.ilovepowershell.com/oneliner-how-to-kill-all-internet-explorer-processes/</guid>
		<description><![CDATA[Because of my self-appointed title as an Ultimate Microsoft Fanman, it really pains me to disclose this One-Liner.  That’s because saying it is a commonly used suggests that Internet Explorer locks up frequently. Ouch!  That hurt to type! Truthfully, it could have been said of Firefox if I used it as much as I use [...]]]></description>
			<content:encoded><![CDATA[<p>Because of my self-appointed title as an Ultimate Microsoft Fanman, it really pains me to disclose this One-Liner.  That’s because saying it is a commonly used suggests that Internet Explorer locks up frequently.</p>
<p>Ouch!  That hurt to type!</p>
<p>Truthfully, it could have been said of Firefox if I used it as much as I use IE.  And to be fair, Internet Explorer might not lock up as much if I didn’t abuse it by keeping 25 windows open all the time, and continue to upgrade to the most recent beta version I can get my PowerShell-scripting hands on.</p>
<p>So when I get stuck, I dropped this One-Liner out there.  It works great, even if the IE window is not responding to close requests through the taskbar, or through the close button on the application itself.  This kills every Internet Explorer window</p>
<blockquote><p>get-process iexplore | stop-process</p></blockquote>
<p>You can exercise more surgical precision by going for only the top processor intensive process (or processes if you change “–First 1” to “-First 2”)</p>
<blockquote><p>get-process iexplore | sort –descending cpu | select –First 1 | stop-process</p></blockquote>
<p>Or by going for only the Internet Explorer windows with active threads</p>
<blockquote><p>get-process iexplore | ? {$_.threads | ? {$_.threadstate –eq “Running”} } | stop-process</p></blockquote>
<p>I really like this method the most.  The thing that gives it an extra edge over the other methods is that if it kills open tabs but not all the tabs on a window, then the tab is reopened automatically.  Hopefully it’s enough of a kick in the pants to get the window open.</p>
<p>Have I overlooked something?  How can it be done better?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilovepowershell.com/oneliner-how-to-kill-all-internet-explorer-processes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

