<?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>PowerShell.cz &#187; ConfigMgr</title>
	<atom:link href="http://powershell.cz/category/configmgr/feed/" rel="self" type="application/rss+xml" />
	<link>http://powershell.cz</link>
	<description>Get-World &#124; ConvertTo-PowerShell</description>
	<lastBuildDate>Mon, 07 May 2012 15:09:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>A quick file processing</title>
		<link>http://powershell.cz/2011/08/14/quick-file-processing/</link>
		<comments>http://powershell.cz/2011/08/14/quick-file-processing/#comments</comments>
		<pubDate>Sun, 14 Aug 2011 08:09:28 +0000</pubDate>
		<dc:creator>makovec</dc:creator>
				<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[MMS]]></category>

		<guid isPermaLink="false">http://powershell.cz/?p=161</guid>
		<description><![CDATA[How to pack&#038;go content of MMS 2011 DVDs.]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://twitter.com/#!/makovec/status/100556298059395072">received</a> DVDs from <a href="http://www.mms-2011.com/">MMS</a> on Monday. What a nice day <img src='http://powershell.cz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  As I wasn&#8217;t in Vegas, these DVDs are opportunity to see all those interesting presentations at home. My wife was out of town this weekend so I had a plan &#8211; MMS party <img src='http://powershell.cz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Wanted to watch everything I marked as interesting. My idea was to create one DVD with presentations I selected and play it on TV (and preferably do not leave my bed).</p>
<p>I moved selected folders to one place, you can see structure of BA02 session folder here (it&#8217;s the same for all sessions):</p>
<p><img class="alignnone" title="Show session folder content" src="http://powershell.cz/images/quick-file-processing/MMS_ShowTree.jpg" alt="" width="420" height="220" /></p>
<p>In directory with session code is places file video.wmv. Eh &#8211; not so good to place every video to root of DVD. So I <span style="text-decoration: line-through;">opened explorer and copied every WMV file to specific location, changed it&#8217;s name to session code and did the same for all sessions I selected</span> used PowerShell to process all files. BTW: If you like <strong>Show-Tree</strong>, it&#8217;s part of <a title="PSCX" href="http://pscx.codeplex.com/" target="_blank">PowerShell Community Extensions</a>.</p>
<p>First I wanted to save session names so I&#8217;ll be able to check session content based on file name (ba02.wmv). One place, where the session name is mentioned, is second line of media.js file:</p>
<p><img class="alignnone" title="media.js file content" src="http://powershell.cz/images/quick-file-processing/MMS_MediaJsContent.jpg" alt="" width="846" height="134" /></p>
<p class="code">PS ToBurn:\&gt; Get-ChildItem -Include media.js -Recurse |% { (Get-Content $_)[1] -match &#8216;^{&#8220;title&#8221;:&#8221;(.*?)&#8221;,&#8217; | Out-Null; $matches[1] }<br />
BA01 &#8211; Configuration Manager State of the Union<br />
BA02 &#8211; Configuration Manager 2007 R3: Technical Update<br />
BA03 &#8211; Configuration Manager 2012 &#8211; Technical Overview<br />
BA04 &#8211; Configuration Manager 2012: Application Management (Part 1 of 3)<br />
BA05 &#8211; Configuration Manager 2012: Application Management (Part 2 of 3)<br />
BA06 &#8211; Configuration Manager 2012: Migrating from 2007 to 2012<br />
&#8230;</p>
<p>As I was working in console (I use aliases as much as possible) and wanted to store this list for future check, my actual command was:</p>
<p class="code">PS ToBurn:\&gt; ls -i media.js -r |% { (gc $_)[1] -match &#8216;^{&#8220;title&#8221;:&#8221;(.*?)&#8221;,&#8217; | Out-Null; $matches[1] } | Out-Printer</p>
<p>Voila &#8211; <strong>Out-Printer</strong> useful again <img src='http://powershell.cz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Second I needed to move video files to my burn folder and rename it.</p>
<p class="code">PS ToBurn:\&gt; ls -i video.wmv -r |% { Move-Item $_ -Destination $(&#8216;ToBurn:\&#8217;+$(Split-path $_.DirectoryName -Leaf)+&#8217;.wmv&#8217;) }</p>
<p>For all WMV files, I moved them to root of ToBurn PSDrive and renamed based on pattern &lt;folder_name&gt;.wmv.</p>
<p>Last point was to remove everything except video files:</p>
<p class="code">PS ToBurn:\&gt; ls * -r |? {$_.name -notlike &#8216;*.wmv&#8217;} | del -force</p>
<p>OK &#8211; then just burn what I just selected and MMS party can begin.</p>
<p><strong>Conclusion:</strong> When I put DVD to my player, it reported: &#8220;Resolution not supported.&#8221; So I used my common solution: notebook + VGA cable.</p>
]]></content:encoded>
			<wfw:commentRss>http://powershell.cz/2011/08/14/quick-file-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

