Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

Browse by Tags

All Tags » Hey!   (RSS)

Hey PowerShell Guy !, How Can I Copy Files Based on Multiple Criteria?

A Translation of the Scripting Guys post : How Can I Copy Files Based on Multiple Criteria? VbScript example, As mostly in this series I point to the original Article for more information. dir c:\Scripts |? {$_ -match "^FS|^CG|^GPS." -and $_.CreationTime
Posted by MoW | 1 Comments
Filed under: ,

Hey PowerShell Guy !,How Can I Delete All the Files in a Folder Except for the Most-Recently Created File?

Another Hit-in-one(liner) translation from a ca 30 lines VbScript example : How Can I Delete All the Files in a Folder Except for the Most-Recently Created File? del *.* -Exclude (dir | sort creationtime -desc)[0] -whatif Remove the -WhatIf to actualy
Posted by MoW | 1 Comments
Filed under: ,

Hey PowerShell Guy !, How Can I Retrieve All the Values in a Registry Key?

Today's Hey Scripting Guy ! column , How Can I Retrieve All the Values in a Registry Key? , Shows a 38 line VbScript to get the Values in a registry key. In a PowerShell console it just takes this simple line to do the same : get-ItemProperty 'hkcu:\Software\Microsoft\Internet
Posted by MoW | 3 Comments
Filed under: ,

Hey PowerShellGuy!,How Can I Check to See if Two Lines of Text are in a File and, If They Are Not, Append Those Lines to the File?

How Can I Check to See if Two Lines of Text are in a File and, If They Are Not, Append Those Lines to the File? Translation to PowerShell of a Hey, Scripting Guy! column that shows you how to check a text file for specific lines containing double quote
Posted by MoW | 0 Comments
Filed under: ,

Hey PowerShell Guy !,How Can I Separate The Month From the Year in a Date String Like 122007?

How Can I Separate The Month From the Year in a Date String Like 122007? [datetime]::ParseExact(122007,'Myyyy',$null) | ft Month,Year You can see you can use ParseExact to convert a custom format to d dateTime OBject from there it is simple of course
Posted by MoW | 3 Comments
Filed under: , ,

Hey PowerShellGuy !, How Can I Determine the Currency Symbol in Use on a Computer?

From the Scripting Son article : How Can I Determine the Currency Symbol in Use on a Computer? 3 ways to do the same in PowerShell : (gp 'hkcu:\Control panel\International').sCurrency (get-culture).NumberFormat.CurrencySymbol '{0:c}' -f 1 And yes we can
Posted by MoW | 1 Comments
Filed under: , ,

Hey PowerShell Guy! How Can I Replace Incorrect Dates in My File Names?

No solutions to post today , so time for a small Hey scripting guy ! translation : How Can I Replace Incorrect Dates in My File Names? dir *.jpg | ren -new {$_.name -replace "(\d{1,2})-(\d{1,2})-07",'$1-$2-08' } To keep the example clear I used exactly
Posted by MoW | 1 Comments
Filed under: ,

Hey PowerShell Guy !, How Can I Remove Extraneous Spaces From Fields in a Text File?

A little one before the, 2008 Winter Scripting Games The PowerShell version of the Hey Scripting guy VBScript version : How Can I Remove Extraneous Spaces From Fields in a Text File? (gc c:\scripts\test.txt) -replace ' {2,}','' PoSH> gc c:\scripts\test.txt
Posted by MoW | 7 Comments
Filed under: ,

Hey PowerShell Guy!, How Can I Create an Windows Form For Displaying Log Files?

In the Hey Scripting guy ! article : How Can I Create an HTA For Displaying Log Files? , I made this example in PowerShell Using Windows Forms using the PSEventing CodePlex project PowerShell Eventing Snapin from Oisin the handle the ItemActivated event
Posted by MoW | 1 Comments
Filed under: , , ,

Attachment(s): textviewer.PNG

Hey PowerShell guy !, The Games Are Afoot! Oh, and Some XML, Too

In TechNet Magazine you can find the Scripting Guy article  The Games Are Afoot! Oh, and Some XML, Too I translated the scripts given for this article into PowerShell   # Create $xml = New-Object xml $root = $xml .CreateElement( " ITChecklist
Posted by MoW | 1 Comments
Filed under: , ,

Hey PowerShell Guy!,How Can I Map Drives Based on Membership in an Active Directory Group and a CSV file.

In this translation of a Hey Scripting guy article to PowerShell based on : How Can I Map Drives Based on Membership in an Active Directory Group When the User Belongs to Multiple Groups? I tuned the example a bit as I did not like the configuration of
Posted by MoW | 4 Comments

Hey PowerShell Guy!, How Can I Retrieve Time Zone Information for a Computer?

As you can see in former posts also I picked up my Hey PowerShell guy series again, I did stop when the ScriptCenter started to provide PowerShell examples also see : Hey, PowerShell Guy ! How Can I .. Sorry forget about it I allready Know . But this
Posted by MoW | 2 Comments
Filed under: ,