<?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>Developer OneNote &#187; PowerShell</title>
	<atom:link href="http://devonenote.com/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://devonenote.com</link>
	<description>Emma&#039;s OneNote for Microsoft Windows, Office and Programming</description>
	<lastBuildDate>Thu, 02 Feb 2012 05:19:49 +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>Using SCVMM 2012 Cmdlets in PowerShell</title>
		<link>http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-scvmm-2012-cmdlets-in-powershell</link>
		<comments>http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 11:39:23 +0000</pubDate>
		<dc:creator>emma</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[System Center]]></category>

		<guid isPermaLink="false">http://devonenote.com/?p=564</guid>
		<description><![CDATA[SCVMM Cmdlets allow SCVMM admin/users to do everything they can do in SCVMM AdminConsole in windows PowerShell command line. In SCVMM 2008 R2, you can run following command in PowerShell to run SCVMM cmdlets. Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager But this does not &#8230; <a href="http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://devonenote.com/2011/09/improve-vm-deploy-performance-in-scvmm/' rel='bookmark' title='Improve VM deploy performance in SCVMM'>Improve VM deploy performance in SCVMM</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2011/03/could-not-load-file-or-assembly-tracewrapper-version1-0-523-0/' rel='bookmark' title='Could not load file or assembly TraceWrapper, Version=1.0.523.0'>Could not load file or assembly TraceWrapper, Version=1.0.523.0</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>SCVMM Cmdlets allow SCVMM admin/users to do everything they can do in SCVMM AdminConsole in windows PowerShell command line. In SCVMM 2008 R2, you can run following command in PowerShell to run SCVMM cmdlets. </p>
<p class="textborder">Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager</p>
<p>But this does not work in SCVMM 2012 as SCVMM 2012 uses PowerShell module. For SCVMM 2012 now you need run following in PowerShell instead</p>
<p class="textborder">Import-Module &quot;C:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\bin\psModules\virtualmachinemanager\virtualmachinemanager&quot;</p>
<p>(This assumes that you have SCVMM 2012 installed on the default location C:\Program Files\Microsoft System Center 2012 )</p>
<p>The PowerShell cmdlets in SCVMM 2012 change a lot in SCVMM 2012, you can get a list of all SCVMM 2012 cmdlets by typing the following at the PowerShell command shell prompt</p>
<p class="textborder">Get-Command -Module virtualmachinemanager -Type cmdlet</p>
<p>And you can run Get-Help on any of the cmdlets to get the syntax for that cmdlet.</p>
<p class="textborder">Get-Help &lt;cmdlet name&gt; -detailed</p>
<p>Update: Microsoft has published the SCVMM 2012 cmdlets help to TechNet, check it out <a title="http://technet.microsoft.com/en-us/library/hh801697.aspx" href="http://technet.microsoft.com/en-us/library/hh801697.aspx">http://technet.microsoft.com/en-us/library/hh801697.aspx</a></p>
<p>Related posts:<ol>
<li><a href='http://devonenote.com/2011/09/improve-vm-deploy-performance-in-scvmm/' rel='bookmark' title='Improve VM deploy performance in SCVMM'>Improve VM deploy performance in SCVMM</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2011/03/could-not-load-file-or-assembly-tracewrapper-version1-0-523-0/' rel='bookmark' title='Could not load file or assembly TraceWrapper, Version=1.0.523.0'>Could not load file or assembly TraceWrapper, Version=1.0.523.0</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure PowerShell to use DotNet 4.0</title>
		<link>http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=configure-powershell-to-use-dotnet-4-0</link>
		<comments>http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 15:41:35 +0000</pubDate>
		<dc:creator>emma</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[DotNet 4.0]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/</guid>
		<description><![CDATA[You might get following error when you load a snap-in that is written by DotNet 4.0. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. This is because by default, PowerShell uses &#8230; <a href="http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://devonenote.com/2010/08/mixed-mode-assembly-error-after-upgrading-to-dotnet-4-0/' rel='bookmark' title='Mixed mode assembly Error After Upgrading to DotNet 4.0'>Mixed mode assembly Error After Upgrading to DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
<li><a href='http://devonenote.com/2010/06/could-not-load-type-system-servicemodel-activation-httpmodule/' rel='bookmark' title='Could not load type System.ServiceModel.Activation.HttpModule'>Could not load type System.ServiceModel.Activation.HttpModule</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You might get following error when you load a snap-in that is written by DotNet 4.0.</p>
<p class="textborder">This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.</p>
<p>This is because by default, PowerShell uses DotNet version 2.0 CLR. To use powershell load DotNet 4.0 assemblies, the following settings need to be added in PowerShell.exe.config under C:\Windows\SysWOW64\WindowsPowerShell\v1.0.</p>
<p class="textborder">&lt;configuration&gt;    <br />&#160;&#160;&#160; &lt;startup useLegacyV2RuntimeActivationPolicy=&quot;true&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;supportedRuntime version=&quot;v4.0.30319&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;supportedRuntime version=&quot;v2.0.50727&quot;/&gt;     <br />&#160;&#160;&#160; &lt;/startup&gt;     <br />&lt;/configuration&gt;</strong></b></p>
<p>Note: </p>
<ol>
<li>Above applies to 64bit windows server 2008 r2. On a 32 bit machine, PowerShell.exe.config can be found at C:\windows\System32\WindowsPowerShell\v1.0</li>
<li>Create PowerShell.exe.config if this file is not found. </li>
</ol>
<p>Related posts:<ol>
<li><a href='http://devonenote.com/2010/08/mixed-mode-assembly-error-after-upgrading-to-dotnet-4-0/' rel='bookmark' title='Mixed mode assembly Error After Upgrading to DotNet 4.0'>Mixed mode assembly Error After Upgrading to DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
<li><a href='http://devonenote.com/2010/06/could-not-load-type-system-servicemodel-activation-httpmodule/' rel='bookmark' title='Could not load type System.ServiceModel.Activation.HttpModule'>Could not load type System.ServiceModel.Activation.HttpModule</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to run ps1 scripts</title>
		<link>http://devonenote.com/2011/01/how-to-run-ps1-scripts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-run-ps1-scripts</link>
		<comments>http://devonenote.com/2011/01/how-to-run-ps1-scripts/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 13:12:34 +0000</pubDate>
		<dc:creator>emma</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://devonenote.com/2011/01/how-to-run-ps1-scripts/</guid>
		<description><![CDATA[PowerShell scripts are text files with &#34;.ps1&#34; extensions that contain PowerShell commands. Starting with Windows Server 2008, PowerShell is built into the OS. For earlier OS versions, you will need to download PowerShell at Microsoft PowerShell Site and install it. &#8230; <a href="http://devonenote.com/2011/01/how-to-run-ps1-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>PowerShell scripts are text files with &quot;.ps1&quot; extensions that contain PowerShell commands. Starting with Windows Server 2008, PowerShell is built into the OS. For earlier OS versions, you will need to download PowerShell at <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx">Microsoft PowerShell Site</a> and install it.</p>
<p>To run ps1 scripts, you first need to enable scripts by running:</p>
<p class="textborder">Set-ExecutionPolicy RemoteSigned</p>
<p>Otherwise, you will get this error message:</p>
<p class="textborder">File &lt;script&gt; cannot be loaded because the execution of scripts is disabled on this system. Please see &quot;get-help about_signing&quot; for more details.</p>
<p>The most common way to run PowerShell scripts is from Windows PowerShell command prompt. You must specify a path to the script to run it. If the script is in your current folder, then you can run it with:</p>
<p class="textborder">.\script.ps1</p>
<p>If the script is in another folder, you need specify the full path:</p>
<p class="textborder">c:\scripts\script.ps1</p>
<ol></ol>
<p>  <span id="more-447"></span><br />
<h3></h3>
<h3>How to enable PowerShell scripts</h3>
<ol>
<li>Open a PowerShell command prompt and type Set-ExecutionPolicy RemoteSigned
<p><a href="http://devonenote.com/wp-content/uploads/2011/01/clip_image001.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://devonenote.com/wp-content/uploads/2011/01/clip_image001_thumb.png" width="480" height="192" /></a></p>
</li>
<li>You will be asked if you are sure
<p><a href="http://devonenote.com/wp-content/uploads/2011/01/clip_image002.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://devonenote.com/wp-content/uploads/2011/01/clip_image002_thumb.png" width="480" height="192" /></a></p>
</li>
<li>Select ‘Y’ and hit &lt;enter&gt;
<p><a href="http://devonenote.com/wp-content/uploads/2011/01/clip_image003.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://devonenote.com/wp-content/uploads/2011/01/clip_image003_thumb.png" width="480" height="192" /></a></p>
</li>
</ol>
<p>You are now setup to run scripts on your machine. Note that if you use a 64 bit machine then you need to set the policy for both x86 and x64 PowerShell. If at any time you want to switch back to not allowing scripts, run “Set-ExecutionPolicy Restricted”. </p>
<p>Related posts:<ol>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2010/07/install-powershell-from-command-line/' rel='bookmark' title='Install PowerShell From Command Line'>Install PowerShell From Command Line</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://devonenote.com/2011/01/how-to-run-ps1-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install PowerShell From Command Line</title>
		<link>http://devonenote.com/2010/07/install-powershell-from-command-line/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=install-powershell-from-command-line</link>
		<comments>http://devonenote.com/2010/07/install-powershell-from-command-line/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 16:42:04 +0000</pubDate>
		<dc:creator>emma</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Command line]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://devonenote.com/2010/07/install-powershell-from-command-line/</guid>
		<description><![CDATA[To install PowerShell on Windows Server 2008 R2 or Hyper-V Server 2008 R2, following features needs to be installed. NetFx2-ServerCore NetFx3-ServerCore MicrosoftWindowsPowerShell Because Powershell is built on DotNet framework, DotNet 2.0 and 3.5&#160; has to be installed prior to PowerShell &#8230; <a href="http://devonenote.com/2010/07/install-powershell-from-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://devonenote.com/2010/07/enable-dotnet-3-5-from-command-line/' rel='bookmark' title='Enable DotNet 3.5 from command line'>Enable DotNet 3.5 from command line</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2011/01/enabledisable-ipv6-in-command-line/' rel='bookmark' title='Enable/Disable ipv6 in command line'>Enable/Disable ipv6 in command line</a></li>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>To install PowerShell on Windows Server 2008 R2 or Hyper-V Server 2008 R2, following features needs to be installed.</p>
<ol>
<li>NetFx2-ServerCore </li>
<li>NetFx3-ServerCore </li>
<li>MicrosoftWindowsPowerShell </li>
</ol>
<p>Because Powershell is built on DotNet framework, DotNet 2.0 and 3.5&#160; has to be installed prior to PowerShell installation.</p>
<p>To install PowerShell from command line, run following from elevated command prompt</p>
<p class="textborder">DISM.exe /online /enable-feature /featurename:NetFx2-ServerCore DISM.exe /online /enable-feature /featurename:NetFx3-ServerCore DISM.exe /online /enable-feature /featurename:MicrosoftWindowsPowerShell </p>
<p>Or run following command if it’s an 64bit machine</p>
<p class="textborder">DISM.exe /online /enable-feature /featurename:NetFx2-ServerCore-WOW64&#160; <br />DISM.exe /online /enable-feature /featurename:NetFx3-ServerCore-WOW64&#160; <br />DISM.exe /online /enable-feature /featurename:MicrosoftWindowsPowerShell-WOW64&#160; </p>
<p>Related posts:<ol>
<li><a href='http://devonenote.com/2010/07/enable-dotnet-3-5-from-command-line/' rel='bookmark' title='Enable DotNet 3.5 from command line'>Enable DotNet 3.5 from command line</a></li>
<li><a href='http://devonenote.com/2011/01/configure-powershell-to-use-dotnet-4-0/' rel='bookmark' title='Configure PowerShell to use DotNet 4.0'>Configure PowerShell to use DotNet 4.0</a></li>
<li><a href='http://devonenote.com/2011/01/enabledisable-ipv6-in-command-line/' rel='bookmark' title='Enable/Disable ipv6 in command line'>Enable/Disable ipv6 in command line</a></li>
<li><a href='http://devonenote.com/2012/01/using-scvmm-2012-cmdlets-in-powershell/' rel='bookmark' title='Using SCVMM 2012 Cmdlets in PowerShell'>Using SCVMM 2012 Cmdlets in PowerShell</a></li>
<li><a href='http://devonenote.com/2011/01/how-to-run-ps1-scripts/' rel='bookmark' title='How to run ps1 scripts'>How to run ps1 scripts</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://devonenote.com/2010/07/install-powershell-from-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

