<?xml version="1.0" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">

	<channel>
		<title>PowerShellCommunity.org General PowerShell</title>
		<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/afv/topicsview/Default.aspx</link>
		<description>General discussions on using Windows PowerShell</description>
		<language>en-US</language>
		<generator>ActiveForums  4.2</generator>
		<copyright>Many thanks to our original sponsors: Quest Software • SAPIEN Technologies • Compellent • Microsoft</copyright>
		<lastBuildDate>Tue, 14 Aug 2012 03:07:34 GMT</lastBuildDate><image><url>http://powershellcommunity.org/Portals/0/community-logo.png</url><title>PowerShellCommunity.org General PowerShell</title><link>http://powershellcommunity.org/Forums/tabid/54/aff/1/afv/topicsview/Default.aspx</link></image>
		<item>
			<title>Posting Guideilnes</title>
			<description>&lt;p&gt;When posting code, click on the Source button in the editor, then enclose your code in &lt; code &gt; and &lt; / code &gt; HTML tags, omitting the spaces between the angle brackets as I did here to bypass the parser.  Sorry for the additional step required.  This is the best we can do for now.  Hopefully we can improve this in the future.&lt;/p&gt;

&lt;code&gt;
ps | foreach-object {
  # do something
}&lt;/code&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/1406/afv/topic/Default.aspx</link>
			<dc:creator>halr9000</dc:creator>
			<pubDate>Tue, 25 Mar 2008 00:01:42 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/1406/afv/topic/Default.aspx</guid>
			<slash:comments>9</slash:comments>
		</item>
		<item>
			<title>Change Service Username and Password</title>
			<description>Hello!&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have been reading around for quite some time now as to what the best way to change the credentials of a service is, with powershell.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I keep stumbling upon this:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;&#160;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;$service.Change($null ,$null ,$null ,$null ,$null ,$null , $user, $password)&#160;&lt;/span&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;I don't know if I'm missing something obvious but every time I try to compile some variation of this (I've tried a lot of them!) I get this error:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;code&gt; You cannot call a method on a null-valued expression. &lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;However according to Google, no one else seems to have had this problem when changing service credentials.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;In addition to this, this seems to be the only way people go about accomplishing this task.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;Any help would be very much appreciated.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;Thanks!&#160;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;background-color: rgb(255, 255, 255); color: rgb(68, 68, 68); font-family: monospace; font-size: 13px; line-height: 18px; &quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8836/afv/topic/Default.aspx</link>
			<dc:creator>fat-chunk</dc:creator>
			<pubDate>Tue, 24 Jul 2012 01:51:02 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8836/afv/topic/Default.aspx</guid>
			<slash:comments>9</slash:comments>
		</item>
		<item>
			<title>secure string and passwords</title>
			<description>Welcome, &lt;br&gt;&lt;br&gt;I can secure string as &lt;br&gt;&lt;br&gt;$secure = Read-Host &quot;Enter Password&quot; -asSecureString &lt;br&gt;$encrypted = ConvertFrom-SecureString $secure -key (32,4,22,3,57,34,254,222,1,1,2,23,42,54,33,234,1,34,2,7,6,5,35,43) &lt;br&gt;$encrypted | set-content C:\temp\pass.txt &lt;br&gt;&lt;br&gt;&lt;br&gt;And use it as &lt;br&gt;&lt;br&gt;&lt;br&gt;$username = 'Domain\xyz' &lt;br&gt;$secure2 = get-content C:\temp\pass.txt | convertto-securestring -key (32,4,22,3,57,34,254,222,1,1,2,23,42,54,33,234,1,34,2,7,6,5,35,43) &lt;br&gt;$password = &amp;#91;System.Runtime.InteropServices.marshal&amp;#93;::PtrToStringAuto(&amp;#91;System.Runtime.InteropServices.marshal&amp;#93;::SecureStringToBSTR($secure2)) &lt;br&gt;$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force)) &lt;br&gt;start-process powershell.exe -ArgumentList &quot;$env:C:\Script.ps1&quot; -Credential $cred &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;but if somebody modify script and write-host $password password is in plain text. How to ovoid it ? And make it most secure. I want to standard users run script with some other Credentials but i dont want that they know password.</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8122/afv/topic/Default.aspx</link>
			<dc:creator>rocafella</dc:creator>
			<pubDate>Wed, 14 Mar 2012 08:13:14 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8122/afv/topic/Default.aspx</guid>
			<slash:comments>4</slash:comments>
		</item>
		<item>
			<title>Remote registry HKCU</title>
			<description>Hi, I'm trying to run attached script in order to know which printer connections a user gots mapped, by reading the registry.&lt;BR&gt;&lt;BR&gt;But this returns zero subkeys, while there should be 4. &lt;BR&gt;I can browse to the regkeys though, just can't get to the values. &lt;BR&gt;If I go directly to the HKU:\SID\Printers\Connections, than it's working without problems. &lt;BR&gt;&lt;BR&gt;Problem is I don't know the SID of the currently logged on user.&#160;&#160;&lt;BR&gt;It seems like it is taking my account to as CurrentUser on the local machine, which sounds reasonable, but I don't want that. &lt;BR&gt;&lt;BR&gt;Can anybody point me into the right direction? Thx! Maybe Impersonate as the logged on user?</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6059/afv/topic/Default.aspx</link>
			<dc:creator>destn</dc:creator>
			<pubDate>Thu, 06 Jan 2011 01:04:43 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6059/afv/topic/Default.aspx</guid>
			<slash:comments>3</slash:comments>
		</item>
		<item>
			<title>Beginner PowerShell Assistance</title>
			<description>Good afternoon,&lt;br&gt;&lt;br&gt;I am just starting to understand bits on how Powershell works and I wish to put together a script that will allow me to do the following instead of having to purchase a 3rd party tool.&lt;br&gt;&lt;br&gt;The company I work for has several remote offices on the domain. Each office is in its own container with Active Directory (NY, LA, NJ, etc). All the computers are on a Windows 7 environment.&lt;br&gt;What I want to do with my script is look for all the computers in the NY container and pull up the software currently installed on each computer and spit it out onto a file somewhere on the computer (like a csv file)&lt;br&gt;I have seen some scripts out there that I downloaded and tried to tinker with but to no avail. One script I found is looking through the entire domain, and when I opened up the script to look at it, i couldnt make heads over heals. would anyone be able to help me out?&lt;br&gt;&lt;br&gt;I have placed it as an attachment. I tried using the CODE command but it made it look all crazy.&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8929/afv/topic/Default.aspx</link>
			<dc:creator>storo1975</dc:creator>
			<pubDate>Tue, 14 Aug 2012 03:07:34 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8929/afv/topic/Default.aspx</guid>
			<slash:comments>13</slash:comments>
		</item>
		<item>
			<title>How to read variables in powershell script from text file</title>
			<description>Dear All,&lt;br&gt;&lt;br&gt;
I want to write a Windows powershell script which will read the variable
 from a text file, sothat I can use it further process. for example, I 
have text file demo.txt and the contents of it is--&lt;br&gt;
Server=xx.xx.xx.xx user=root&lt;br&gt;
Server=xx.xx.xx.xx user=root1&lt;br&gt;&lt;br&gt;
Now, I have demo.ps1 script and I want to read server and user names separately to perform the specific task for each server and can use it where needed-&lt;br&gt;&lt;br&gt;
connect server Server -username user&lt;br&gt;&lt;br&gt;
but when I am trying it with Get-Content, it is reading the whole line,not a single variable.&lt;br&gt;&lt;br&gt;
foreach( $Server in Get-Content C:\Scripts\demo.txt)&lt;br&gt;
{&lt;br&gt;
     connect server $Server -username $user&lt;br&gt;
}&lt;br&gt;&lt;br&gt;&lt;br&gt;
Please provide me your valuable suggestions.&lt;br&gt;&lt;br&gt;
Thanks in Advance...</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6815/afv/topic/Default.aspx</link>
			<dc:creator>silverstone</dc:creator>
			<pubDate>Tue, 28 Jun 2011 19:44:22 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6815/afv/topic/Default.aspx</guid>
			<slash:comments>5</slash:comments>
		</item>
		<item>
			<title>Pass PS variable as parameter in batch file.</title>
			<description>HI,&lt;br&gt;&lt;br&gt;I want to send variable value to batch file as command line argument.&lt;br&gt;&lt;br&gt;x.ps1&lt;br&gt;-----&lt;br&gt;$a&lt;br&gt;$b&lt;br&gt;Invoke - expression &quot;d:\abc.bat&quot;&#160;&#160;&#160; // here i want to send $a and $b to abc.bat file so i can read those variable in batch file..&lt;br&gt;&lt;br&gt;abc.bat&lt;br&gt;-------&lt;br&gt;here i want to read $a and $b value&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/5105/afv/topic/Default.aspx</link>
			<dc:creator></dc:creator>
			<pubDate>Wed, 12 May 2010 03:32:21 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/5105/afv/topic/Default.aspx</guid>
			<slash:comments>2</slash:comments>
		</item>
		<item>
			<title>Powershell Date -&amp;gt; formatted string</title>
			<description>I am frustrated beyond belief.&#160; This is so simple, and powershell flat out gets it wrong:&lt;br&gt;&lt;br&gt;PS C:\test&gt; echo $a&lt;br&gt;&lt;br&gt;Tuesday, June 01, 2010 2:16:47 PM&lt;br&gt;&lt;br&gt;&lt;br&gt;PS C:\test&gt; $b=$a.AddDays(-14)&lt;br&gt;PS C:\test&gt; echo $b&lt;br&gt;&lt;br&gt;Tuesday, May 18, 2010 2:16:47 PM&lt;br&gt;&lt;br&gt;&lt;br&gt;PS C:\test&gt; $c=&amp;#91;string&amp;#93;$b&lt;br&gt;PS C:\test&gt; echo $c&lt;br&gt;05/18/2010 14:16:47&lt;br&gt;PS C:\test&gt; $d=$c.substring(1,10)&lt;br&gt;PS C:\test&gt; echo $d&lt;br&gt;5/18/2010&lt;br&gt;PS C:\test&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Dude, where's my leading '0'?&lt;br&gt;&lt;br&gt;(Yeah, the one that was in the STRING above it?)&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/5202/afv/topic/Default.aspx</link>
			<dc:creator>Anonymous</dc:creator>
			<pubDate>Tue, 01 Jun 2010 04:19:39 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/5202/afv/topic/Default.aspx</guid>
			<slash:comments>4</slash:comments>
		</item>
		<item>
			<title>Get-QADUser help</title>
			<description>&lt;p&gt;Hi, i'm trying to limit the number of properties returned from the following search. Would only like the name, description and accountexpires properties, but this returns all the user account properties.&lt;br&gt;&lt;br&gt;I am just trying to pull out all accounts due to expire in the next 2 weeks.&lt;br&gt;&lt;br&gt;$fortnight = (get-date).AddDays(14).ToString(&quot;d MMMM yyyy&quot;)&lt;br&gt;Get-QADUser -DontUseDefaultIncludedProperties -IncludedProperties AccountExpires,Description -accountexpiresbefore $fortnight -searchroot &quot;OU=users,dc=domain,dc=domain&quot; | export-csv C:\ExpiringAccounts.csv&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;David&lt;/p&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7897/afv/topic/Default.aspx</link>
			<dc:creator>dave</dc:creator>
			<pubDate>Thu, 26 Jan 2012 16:37:12 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7897/afv/topic/Default.aspx</guid>
			<slash:comments>6</slash:comments>
		</item>
		<item>
			<title>Missing statement block after if ( condition ). error</title>
			<description>I'm getting the following error&lt;br&gt;&lt;br&gt;Missing statement block after if ( condition ).&lt;br&gt;&#160;&lt;br&gt;When i run this&#160;in&#160;a script but i don't see why, can anyone help?&lt;br&gt;&lt;br&gt;get-wmiobject -ComputerName $Target win32_operatingsystem|select -exp DataExecutionPrevention_SupportPolicy&lt;br&gt;&lt;br&gt;If( (&quot;get-wmiobject -ComputerName $Target win32_operatingsystem&quot;).DataExecutionPrevention_SupportPolicy -eq 3)} &lt;br&gt;&lt;br&gt;Write-Output &quot;= OptOut - DEP is enabled for all processes. Administrators can manually create a list of specific applications which do not have DEP applied&quot;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7216/afv/topic/Default.aspx</link>
			<dc:creator>Hector</dc:creator>
			<pubDate>Fri, 09 Sep 2011 06:40:53 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7216/afv/topic/Default.aspx</guid>
			<slash:comments>4</slash:comments>
		</item>
		<item>
			<title>Help, Import-pssession scripting problem, probably scope</title>
			<description>Good day,&lt;br&gt;&lt;br&gt;&lt;br&gt;I have what seems to be a scope problem. When I run the following in a live (interactive) PowerShell window it works and allows my imported pssession to work properly. But if the import-pssession is run from an imported script module it won't import the session in the global scope, rather it seems like the script scope. So the question is, how do I import a pssession using a script and have the imported session available to the user running in the live powershell window.&lt;br&gt;&lt;br&gt;&lt;br&gt;Running this in a live (interactive powershell window):&lt;br&gt;&lt;br&gt;&lt;br&gt;PS 1&gt; #create a new pssession on &quot;myserver&quot;&lt;br&gt;PS 2&gt; New-PSSession -computername myserver.example.com&lt;br&gt;PS 3&gt; # Import the session and module that is on that remote server, add a prefix called RM&lt;br&gt;PS 4&gt; import-pssession&#160; -session (get-pssession -computername myserver.example.com) -Module ModuleThatRunsOnMyserver -Prefix RM&lt;br&gt;PS 5&gt; #Run a command&lt;br&gt;PS 6&gt; Get-RMUser -username jdoe&lt;br&gt;&lt;br&gt;---- this returns the proper result ----&lt;br&gt;&lt;br&gt;&lt;br&gt;Now I make a module to make things easier for me and other users:&lt;br&gt;&lt;br&gt;1&gt; # Start of module&lt;br&gt;2&gt; # Module file name is called: module.psm1&lt;br&gt;3&gt; function global:Connect-Myserver ($computername=&quot;myserver.example.com&quot;)&lt;br&gt;4&gt; {&lt;br&gt;5&gt; New-PSSession -computername $computername&lt;br&gt;6&gt; Invoke-Command -session (get-pssession -computername $computername) -ScriptBlock {add-pssnapin -name ModuleThatRunsOnMyserver}&lt;br&gt;7&gt; Import-PSSession -session (get-pssession -computername $computername) -Module ModuleThatRunsOnMyserver -Prefix RM&lt;br&gt;8&gt; }&lt;br&gt;9&gt; function Get-MyUser ($username){Get-RMUser $username}&lt;br&gt;10&gt; # End of module&lt;br&gt;&lt;br&gt;Then in the live powershell window I do this:&lt;br&gt;&lt;br&gt;PS 7&gt; import-module module.psm1&lt;br&gt;PS 8&gt; Connect-Myserver&lt;br&gt;PS 9&gt; Get-MyUser jdoe&lt;br&gt;PS 10&gt; # this returns the user jdoe properly&lt;br&gt;PS 11&gt; # but if I want to use the prefixed RM command it is not found&lt;br&gt;PS 12&gt; Get-RMUser jdoe&lt;br&gt;PS 13&gt; # Error: Command or function not found.&lt;br&gt;PS 14&gt; # But if I were to run in the live window this:&lt;br&gt;PS 15&gt; Import-PSSession -session (get-pssession -computername myserver.example.com) -Module ModuleThatRunsOnMyserver -Prefix RM -allowclobber&lt;br&gt;PS 16&gt; #then run&lt;br&gt;PS 17&gt; Get-RMUser jdoe&lt;br&gt;PS 18&gt; # This returns the proper result.&lt;br&gt;&lt;br&gt;So the question is how can I import the pssession in a scripted way and be able to use the RM prefixed commands?&lt;br&gt;&lt;br&gt;Sorry for this being long, it's hard to explain what's going on without an example.&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks for any help,&lt;br&gt;-Matt</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6977/afv/topic/Default.aspx</link>
			<dc:creator>mgohmann</dc:creator>
			<pubDate>Thu, 28 Jul 2011 01:41:21 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6977/afv/topic/Default.aspx</guid>
			<slash:comments>1</slash:comments>
		</item>
		<item>
			<title>Out-File to same line of text</title>
			<description>Hello&lt;br&gt;&lt;br&gt;I'm working on a script to report the status of printers from our print server and need a little assitance with the output portion.&#160; I want to output to a txt file, something like this.&lt;br&gt;&lt;br&gt;PrinterName,Printer Status,&quot;Please Check&quot;&#160;&#160;&#160;&#160;&#160; (something like that)&#160; Here's what I have for code.&lt;br&gt;&lt;br&gt;$pservers = &quot;printerserver01&quot;,&quot;printserver02&quot;&lt;br&gt;$p = Get-WmiObject win32_printer -computername $pservers&lt;br&gt;&lt;br&gt;foreach ($i in $p) {&lt;br&gt;&#160;&#160;&#160; if ($i.PrinterStatus -eq &quot;1&quot;)&lt;br&gt;&#160;&#160;&#160; &#160;&#160;&#160; {Write-Output &quot;Printer is idle '$i.SystemName'&quot; &gt; c:\test.txt}&lt;br&gt;&#160;&#160;&#160; &lt;br&gt;}&lt;br&gt;&lt;br&gt;The problem I'm having is the output is very messy in the test.txt file.&#160; I also tried out-file but that used a different line item per result.&#160; Any suggestions?&#160; I'm new so please bare with me.&#160; :)&#160; I think this is really easy, I'm just missing something in the output formatting stuff.&lt;br&gt;&lt;br&gt;With this code I can write the output to the screen, but I just can't seem to figure out how to get this exact output to a text file without skipping lines or getting errors.&lt;br&gt;&lt;br&gt;$pservers = &quot;printerserver01&quot;,&quot;printserver02&quot;&lt;br&gt;$p = Get-WmiObject win32_printer -computername $pservers&lt;br&gt;$output = &quot;c:\PrinterReport.txt&quot;&lt;br&gt;&lt;br&gt;foreach ($i in $p) {&lt;br&gt;&#160;&#160;&#160; if ($i.PrinterStatus -eq &quot;1&quot;)&lt;br&gt;&#160;&#160;&#160; &#160;&#160;&#160; {write-host &quot;Printer Share Name: &quot;$i.ShareName,&quot;Printer Status: &quot;$i.PrinterStatus}&lt;br&gt;&#160;&#160;&#160; &lt;br&gt;&#160;&#160;&#160; &lt;br&gt;}&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/3759/afv/topic/Default.aspx</link>
			<dc:creator></dc:creator>
			<pubDate>Sat, 04 Apr 2009 11:50:25 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/3759/afv/topic/Default.aspx</guid>
			<slash:comments>12</slash:comments>
		</item>
		<item>
			<title>Comparing two text files</title>
			<description>Hi all,&lt;br&gt;I want to compare two text filles, a and b. If anything is different, I'd like to send an email including whatever has changed. I'm basically pulling all of the accounts from the domain admins group, saving that to a text file called domainadminscurrent.txt This gives me a current list of the accounts that are in there. Now I'll pull all of the accounts and put them in a text file called domainadminsnew.txt and compare the two files. I'll write this out to a file called domainadminscompare.txt If i add or delete an account from the domain admins group I'll see &lt;= or =&gt; in the domainadminscompare.txt file. How can i pull only what's changed and sent that in an email. For example John Doe has been added to the domain admins group. Heres what I have so far.&lt;br&gt;&lt;br&gt;New-Item -ItemType file DomainAdminsNew.txt -force&lt;br&gt;&lt;br&gt;$users = &amp;#91;adsi&amp;#93;&quot;LDAP://cn=Domain Admins,ou=Groups,dc=company,dc=com&quot;&lt;br&gt;&lt;br&gt;Clear-Content DomainADminsNew.txt&lt;br&gt;&lt;br&gt;foreach ($user in $users.Member) {&lt;br&gt;((&amp;#91;adsi&amp;#93;&quot;LDAP://$user&quot;).displayname) | out-file -filepath DomainAdminsNew.txt -append&lt;br&gt;&lt;br&gt;$a = Get-Content DomainAdminsCurrent.txt&lt;br&gt;$b = Get-Content DomainAdminsNew.txt&lt;br&gt;&lt;br&gt;Clear-Content DomainAdminsCompare.txt&lt;br&gt;&lt;br&gt;Compare-Object -referenceObject $a -differenceObject $b -includeEqual | Format-Table -auto | out-file -filepath DomainAdminsCompare.txt -width 150&lt;br&gt;&lt;br&gt;}&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/3554/afv/topic/Default.aspx</link>
			<dc:creator>gmagerr</dc:creator>
			<pubDate>Tue, 06 Jan 2009 02:23:59 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/3554/afv/topic/Default.aspx</guid>
			<slash:comments>7</slash:comments>
		</item>
		<item>
			<title>Formatting an array to a table</title>
			<description>&lt;p&gt;I am trying to create a process that goes and checks to see if a service is running. If it is I will stop the service and then go into a folder and remove certain temp files. For testing purposes I have created a folder on c:\ that has copies of certain files. My script will check to see if files exist and if so lists them out. Eventually I will delted them and I want to create a log that lists the message if the process was running, how many files were deleted and the date/time.&lt;br&gt;&lt;br&gt;In the first script I have accomplish this however using Select-Object I haven't found a way to format the columns. The second script below does format it in a table but I get back 3 rows. I am sure it has to do with my limited knowledge on Powershell and hash tables/arrays. If anyone is able to help out I would be very grateful. &lt;br&gt;&lt;br&gt;Also in my second script if someone could explain where I am going wrong when trying to put it into a hash table I would be most grateful.&lt;br&gt;&lt;br&gt;&lt;br&gt;..........Script that is working but columns are too wide&lt;br&gt;&lt;br&gt;$process = Get-Process calc -ErrorAction silentlycontinue &lt;br&gt;$logmessage = @() &lt;br&gt;$outstring = @() &lt;br&gt;&lt;br&gt;$a = Get-Date $FileDateString = &amp;#91;string&amp;#93;$a.Month + &amp;#91;string&amp;#93; $a.Day + &amp;#91;string&amp;#93;$a.Year + &amp;#91;string&amp;#93;$a.Hour + &amp;#91;string&amp;#93;$a.Minute + &amp;#91;string&amp;#93;$a.Second &lt;br&gt;&lt;br&gt;$DateString = &amp;#91;string&amp;#93;$a.Month + '/' + &amp;#91;string&amp;#93; $a.Day + '/' + &amp;#91;string&amp;#93;$a.Year + '/' + &amp;#91;string&amp;#93;$a.Hour + &amp;#91;string&amp;#93;$a.Minute + &amp;#91;string&amp;#93;$a.Second &lt;br&gt;&lt;br&gt;###Check to if a process is running - For testing purposes we are using calc.exe &lt;br&gt;$message = if ($process) { &quot;BIBusTKServerMain Killed&quot;} else { &quot;No Process Running&quot; } &lt;br&gt;&lt;br&gt;###Check the folder to see what files are going to be deleted - Give a total &lt;br&gt;&lt;br&gt;$Dir = Get-Childitem C:\TempFilesForTestingCopy&lt;br&gt;&#160;&lt;br&gt;$List = $Dir | Where-object {$_.BaseName -like &quot;uda*&quot;} &lt;br&gt;foreach ($_ in $List ){$_.name &lt;br&gt;$count = $count +1}&lt;br&gt;&#160;$countMessage = &quot;Number of files deleted &quot; +$count &lt;br&gt;$totalcount = $count&lt;br&gt;&#160;&lt;br&gt;###Create and array of the data to be written to the log file $outstring = ($DateString + $message + $count) | Select-Object @{n='Date';e={$DateString}},@{n='Message';e={$message}},@{n='Number of Files Deleted';e={$count}} &lt;br&gt;&lt;br&gt;##This is how I want it to work but using the tables to get the proper width of the columns &lt;br&gt;&lt;br&gt;$outstring | out-File c:\debug_$FileDateString.txt &lt;br&gt;&lt;br&gt;Write-Host $outstring $outstring | out-File c:\debug_$FileDateString.txt&lt;br&gt;&lt;br&gt;&lt;br&gt;..........Script that is working but 3 rows are returned.&lt;br&gt;&lt;br&gt;$process = Get-Process calc -ErrorAction silentlycontinue &lt;br&gt;$logmessage = @() &lt;br&gt;$a = Get-Date&lt;br&gt;&lt;br&gt;$FileDateString = &amp;#91;string&amp;#93;$a.Month + &amp;#91;string&amp;#93; $a.Day + &amp;#91;string&amp;#93;$a.Year + &amp;#91;string&amp;#93;$a.Hour + &amp;#91;string&amp;#93;$a.Minute + &amp;#91;string&amp;#93;$a.Second &lt;br&gt;&lt;br&gt;$DateString = &amp;#91;string&amp;#93;$a.Month + '/' + &amp;#91;string&amp;#93; $a.Day + '/' + &amp;#91;string&amp;#93;$a.Year + '/' + &amp;#91;string&amp;#93;$a.Hour + &amp;#91;string&amp;#93;$a.Minute + &amp;#91;string&amp;#93;$a.Second &lt;br&gt;&lt;br&gt;############&lt;br&gt;&lt;br&gt;$message = if ($process) { &quot;BIBusTKServerMain Killed&quot;} else { &quot;No Process Running&quot; }&lt;br&gt;&lt;br&gt;############ &lt;br&gt;&lt;br&gt;$Dir = Get-Childitem C:\TempFilesForTestingCopy &lt;br&gt;&lt;br&gt;############&lt;br&gt;&lt;br&gt;$List = $Dir | Where-object {$_.BaseName -like &quot;uda*&quot;} &lt;br&gt;foreach ($_ in $List ){$_.name &lt;br&gt;$count = $count +1} &lt;br&gt;$countMessage = &quot;Number of files deleted &quot; +$count #Not being used &lt;br&gt;$totalcount = $count &lt;br&gt;&lt;br&gt;############&lt;br&gt;&lt;br&gt;$outstringinfo = @{} &lt;br&gt;&lt;br&gt;$outstringinfo.Date = $DateString &lt;br&gt;$outstringinfo.Message = $message &lt;br&gt;$outstringinfo.totalcount = $totalcount&lt;br&gt;&#160;&lt;br&gt;$table =&lt;br&gt;&#160;&lt;br&gt;@{Expression={$outstringinfo.Date};Label=&quot;Date&quot;;Width=20 } , &lt;br&gt;@{Expression={$outstringinfo.Message};Label=&quot;Message&quot;;Width=35} , &lt;br&gt;@{Expression={$outstringinfo.totalcount};Label=&quot;count&quot;;Width=20}&lt;br&gt;&lt;br&gt;$outstringinfo | Format-Table $table | Out-String -Width 75 | out-file c:\debug_$FileDateString.txt &lt;br&gt;&lt;br&gt;Write-Host $outstringinfo&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7924/afv/topic/Default.aspx</link>
			<dc:creator>renee</dc:creator>
			<pubDate>Wed, 01 Feb 2012 23:52:24 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/7924/afv/topic/Default.aspx</guid>
			<slash:comments>5</slash:comments>
		</item>
		<item>
			<title>Powershell script to monitor disk space for specific drive</title>
			<description>Hello , &lt;br&gt;&lt;br&gt;I want a powershell script to monitor disk space ( total , used , free , % free) for&#160; a list of servers and it should take two things as argument from input file.&lt;br&gt;&lt;br&gt;i,e server name and drive letter.&lt;br&gt;&lt;br&gt;For eg:&lt;br&gt;&lt;br&gt;server1,c:&lt;br&gt;server2,d:&lt;br&gt;server3,f:&lt;br&gt;&lt;br&gt;so Finally the powershell script should show disk space for server 1 , 2 ,3 and only drive letters c,d and F respectively in excel format.&lt;br&gt;&lt;br&gt;Your prompt reply will be much appreciated.&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6824/afv/topic/Default.aspx</link>
			<dc:creator>cheat3</dc:creator>
			<pubDate>Wed, 29 Jun 2011 21:51:37 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/6824/afv/topic/Default.aspx</guid>
			<slash:comments>14</slash:comments>
		</item>
		<item>
			<title>Locking/Unlocking Windows 7 Workstations Remotely</title>
			<description>Here's my issue: &#160;I have 9 computers at my desk, mixed between POSIX and windows - I'm also an admin - so when someone pulls me up from my desk I have to lock all the open stations and then unlock them when I get back (typically one at a time as needed). &#160;I've managed to automate the screen locks on all the POSIX boxes with an ssh command and some bash scripts, but I can't figure out how to lock/unlock the windows workstations remotely (they are already logged in, though logging in remotely as a console session would be nice, I don't hold my hopes up for this).&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Is this possible to do through PowerShell or any method short of me writing a c# program that runs constantly on the child machines listening for a command to lock/unlock? &#160;It is only for a single user account, the same user account is being used on the parent machine.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Any help would be greatly appreciated - thank you for reading :)&lt;/div&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8612/afv/topic/Default.aspx</link>
			<dc:creator>CoryG</dc:creator>
			<pubDate>Mon, 18 Jun 2012 10:10:10 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8612/afv/topic/Default.aspx</guid>
			<slash:comments>3</slash:comments>
		</item>
		<item>
			<title>How to get substrings!</title>
			<description>&lt;div&gt;Hi, my HR wants to have a csv file containing the following;&lt;/div&gt;
		&lt;div&gt;
				&lt;br&gt;
		&lt;/div&gt;
		&lt;div&gt;Employee code: 100017&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;/span&gt;&lt;/div&gt;
		&lt;div&gt;File location: y:\Employees\100017AnnNiels\Application.doc&lt;/div&gt;
		&lt;div&gt;Document: Application&lt;/div&gt;
		&lt;div&gt;
				&lt;br&gt;
		&lt;/div&gt;
		&lt;div&gt;As you can see Employee code and Document are substrings of the file location&lt;/div&gt;
		&lt;div&gt;
				&lt;br&gt;
		&lt;/div&gt;
		&lt;div&gt;I have tried the below but I'm not that good to using substrings;&lt;/div&gt;
		&lt;div&gt;
				&lt;br&gt;
		&lt;/div&gt;
		&lt;div&gt;Get-ChildItem &quot;D:\Downloads\PowerShell Script&quot; -recurse |&lt;/div&gt;
		&lt;div&gt;foreach {&lt;/div&gt;
		&lt;div&gt;
				&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;
				&lt;/span&gt;New-Object psobject -Property @{&lt;/div&gt;
		&lt;div&gt;&#160; &#160; &#160; &#160; Employee code=$_.Name.Substring(4) &#160; &#160; &#160;&#160;&lt;/div&gt;
		&lt;div&gt;&#160; &#160; &#160; &#160; FileLocation=$_.Name;&lt;/div&gt;
		&lt;div&gt;&#160; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;/span&gt;Document=$_.Name.Substring(4)&lt;/div&gt;
		&lt;div&gt;&#160; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;&lt;/span&gt;}} | Export-Csv &quot;D:\Downloads\report.csv&quot;&lt;/div&gt;
		&lt;div&gt;
				&lt;br&gt;
		&lt;/div&gt;
		&lt;div&gt;I hope you can help me!&lt;/div&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8915/afv/topic/Default.aspx</link>
			<dc:creator>mjoxp</dc:creator>
			<pubDate>Wed, 08 Aug 2012 18:52:46 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8915/afv/topic/Default.aspx</guid>
			<slash:comments>2</slash:comments>
		</item>
		<item>
			<title>PathTooLongException</title>
			<description>&lt;p&gt;Upfront I'd like to say thanks to Marco Shaw on this forum, it was his post that gave me the '-ErrorVariable err' code, which enabled me to log the errors.&lt;br&gt;&lt;code&gt;
&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$Files&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;Get-Childitem&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$TargetFolder&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Include&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$Extension&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Recurse&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Force&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-ErrorVariable&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;err&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; | &lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;Where&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; {&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$_&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;.LastWriteTime &lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-le&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot;$LastWrite&quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;}
&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;foreach&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$File&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;in&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$Files&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;)
{
&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#0000ff&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$File&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-ne&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$NULL&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;) 
{
&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageTemp&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$File&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;.Length&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;/&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;1MB
&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageReclaimed&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageReclaimed&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageTemp
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$output&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot;Would Delete File $File,&quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$File&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;.&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#8b4513&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#8b4513&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#8b4513&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;LastWriteTime
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$output&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; | &lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;out-file&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$ResultFile&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-append&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;}
}
&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageSaved&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot;{0:N2}&quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-f&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageReclaimed
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$Now&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;Get-Date
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$EndMessage&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;=&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot;Finished file cleanup &quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$Now&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot; Storage Reclaimed &quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$StorageSaved&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#ff0000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;+&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800000&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&quot;MB&quot;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;Write-Output&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$EndMessage&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; | &lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;out-file&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$ResultFile&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Append
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$err&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt; | &lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;ForEach-Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;{&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;Add-Content&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Path&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$ErrLog&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;i&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#5f9ea0&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;-Value&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font color=&quot;#800080&quot; size=&quot;2&quot; face=&quot;Courier New&quot;&gt;$_&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;&lt;font size=&quot;2&quot; face=&quot;Courier New&quot;&gt;.targetobject}
&lt;/code&gt;&lt;br&gt;&lt;br&gt;Result:&lt;br&gt;Started file cleanup 03/13/2012 09:58:37&lt;br&gt;Would Delete File C:\Scripts\one\twoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThisfolder\three\Four\New Text Document.txt,03/08/2012 17:04:31&lt;br&gt;Would Delete File C:\Scripts\one\twoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThisfolder\three\New Text Document.txt,03/06/2012 16:58:32&lt;br&gt;Would Delete File C:\Scripts\one\New Text Document.txt,03/07/2012 11:18:35&lt;br&gt;Would Delete File C:\Scripts\one\test.txt,03/08/2012 13:06:50&lt;br&gt;Finished file cleanup 03/13/2012 09:58:37 Storage Reclaimed 0.08MB&lt;br&gt;&lt;br&gt;Error Log:&lt;br&gt;C:\Scripts\one\twoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxThisfolder&lt;br&gt;&lt;br&gt;This script is currently to list all .txt files older than a specified age within a folder structure. Once it works it will be used to delete .tmp files older than a certain age.&lt;br&gt;&lt;br&gt;The problem I am having is that if within a subfolder there are two or more .txt files older than specified age and one of them has a file name that generates the PathTooLongException the code stops processing that folder and doesn't list the other .txt files within that folder that are older than the specified age.&lt;br&gt;&lt;br&gt;The Error Log shows the folder that contains a file which generates the PathTooLongException, but this folder contains another file which does not exceed the path length and should be listed within the Result.&lt;br&gt;&lt;br&gt;Any help greatly appreciated.&lt;br&gt;&lt;br&gt;Pete.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8108/afv/topic/Default.aspx</link>
			<dc:creator>PeteL</dc:creator>
			<pubDate>Mon, 12 Mar 2012 19:54:31 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8108/afv/topic/Default.aspx</guid>
			<slash:comments>12</slash:comments>
		</item>
		<item>
			<title>Text file with name-value pairs to table</title>
			<description>I'm fairly new to powershell and I'm stuck on a script I'm trying to write that reads a text file and creates name-value pairs and puts them into a table or spreadsheet.&#160; The text files come from the output of the HPNetSvy command from HP blade servers which dumps the network config info. I'm trying to get info about NIC teaming setup into a nice spreadsheet for comparing setup between servers. The problem is not every server is configured for NIC teaming so the text files can very greatly on what name-value pairs they contain. &lt;br&gt;&lt;br&gt;So far I've read the text file and parsed out the name-value pairs. Now I'm stuck on where to go next. Since not every server is going to have the same name-value pairs, how do I get these to line up correctly in the spreadsheet easily. I would like the column headings to contain all the possible headings I want to collect and then each row will be a different server and then populate each column with the correct value. I'm not that familiar with hash tables and custom objects but I have one script thats similar that uses custom objects I just don't know exactly how to match up the data to the correct columns easily. There's up to 700 or so name-value pairs, I may not need them all but I'd like most of them just to be thorough, you know you can never have to much data.&lt;br&gt;&lt;br&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8852/afv/topic/Default.aspx</link>
			<dc:creator>Jason</dc:creator>
			<pubDate>Fri, 27 Jul 2012 00:27:47 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8852/afv/topic/Default.aspx</guid>
			<slash:comments>14</slash:comments>
		</item>
		<item>
			<title>Function to add site to Intranet zone in IE</title>
			<description>&lt;p&gt;Hello, PoSh Gurus!&lt;br&gt;&lt;br&gt;I've about given up and have no idea what I'm doing wrong. What I'm trying to do is create a script (Add-IntranetSite.ps1) to add as a Group Policy as a logon script to add domains (domain1.com, etc.) as parameters and have them added to the Local Intranet Zone in IE.&lt;br&gt;&lt;br&gt;I know the keys and values are correct; I've tested extensively but I can't get the function to work by doing the following:&lt;br&gt;&lt;br&gt;&amp; .\Add-IntranetSite.ps1 domain1.com domain2.org domain3.net&lt;br&gt;&lt;br&gt;Here's what I have:&lt;br&gt;&lt;br&gt;###########################&lt;br&gt;function Add-IntranetSite {&#160;&lt;br&gt;&#160;&#160;&#160;Param (&amp;#91;string&amp;#91;&amp;#93;&amp;#93;$domain)&#160;&lt;br&gt;&lt;br&gt;&#160;&#160;&#160;$mainkey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\'&#160;&lt;br&gt;&lt;br&gt;&#160;&#160;&#160;foreach ($dom in $domain ) {&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;If ( Test-Path -Path ($mainkey + $dom) -ErrorAction SilentlyContinue )&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Remove-Item -Path ($mainkey + $dom) -Force -Recurse New-Item -Path ($mainkey + $dom) -Force&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;New-ItemProperty -Path ($mainkey + $dom) -Name * -Value 1 -PropertyType DWORD&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;Else&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;New-Item -Path ($mainkey + $dom) -Force&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;New-ItemProperty -Path ($mainkey + $dom) -Name * -Value 1 -PropertyType DWORD&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&lt;br&gt;&#160;&#160;&#160;&#160;&#160;&#160;} &lt;br&gt;}&lt;br&gt;###########################&lt;br&gt;&lt;br&gt;I can get things to work sometimes from with powershell after the function is loaded, but I when I try to &lt;strong&gt;pass&lt;/strong&gt; the parameters without having the function loaded, it doesn't work, even by adding &quot;Add-IntranetSite $domain&quot; at the end of that script.&lt;br&gt;&lt;br&gt;I'm new to PowerShell so sorry if I made a huge blunder.&lt;br&gt;&lt;br&gt;Thanks in advance!&lt;br&gt;Manny&lt;/p&gt;</description>
			<link>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8622/afv/topic/Default.aspx</link>
			<dc:creator>Manny</dc:creator>
			<pubDate>Tue, 19 Jun 2012 08:03:34 GMT</pubDate>
			<guid>http://powershellcommunity.org/Forums/tabid/54/aff/1/aft/8622/afv/topic/Default.aspx</guid>
			<slash:comments>1</slash:comments>
		</item><atom:link href="http://powershellcommunity.org/DesktopModules/ActiveForums/feeds.aspx?portalid=0&amp;forumid=1&amp;tabid=54&amp;moduleid=413" rel="self" type="application/rss+xml" />
	</channel></rss>