Showing results for Sean Kearney - Scripting Blog [archived]

Jun 28, 2016
0
0

PowerTip: List all subfolders under a target path with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Get-Childitem to provide a printable list of all folders under a path. I used to use tree.com to get a list of folders on a computer. Is there something close to that in PowerShell? Maybe something I could print? If you were to use Get-Childitem combined with Select-Object, you could get a pretty clean list. Here’s an example that t...

Windows PowerShellPowerTipguest blogger
Jun 28, 2016
0
0

Erase files based on date by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Honorary Scripting Guy, Sean Kearney, relates his first experience with PowerShell. I was curious just how difficult it is to use Windows PowerShell. For example, how difficult is it to erase files based on the current date? Honorary Scripting Guy, Sean Kearney, is here today, and I can completely relate to exactly what you’ve said. I ...

Windows PowerShellguest bloggerSean Kearney
Jun 27, 2016
0
0

PowerTip: Use a destructive PowerShell cmdlet safely

Doctor Scripto
Doctor Scripto

Summary: Use the –whatif parameter with PowerShell cmdlets to test code live. I heard that PowerShell has a built-in safety switch to many of its cmdlets. Could you show me an example of it in use? No problem. You’re referring to the –whatif parameter, which is meant to show you what would happen if you used a PowerShell cmdlet without actually ...

Windows PowerShellPowerTipguest blogger
Jun 27, 2016
2
4

Use Windows PowerShell to search for files

Doctor Scripto
Doctor Scripto

Summary: Use Get-Childitem to search the files system with PowerShell. I saved a file somewhere on my computer and can’t find it. Is there a way to use Windows PowerShell to find it? Honorary Scripting Guy, Sean Kearney, is here today to show you a cool trick I use all the time. I use PowerShell to search for things constantly! Why PowerShell?...

Windows PowerShellguest bloggerSean Kearney
Jun 24, 2016
0
0

PowerTip: Remove trailing space from a string by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the trim() method to remove leading and trailing spaces from a string. Could you do me a huge favor and show me how to get rid of spaces before and after a string in PowerShell? No problem at all. All you need to do is apply the trim() method to remove all the output. You can also use trimstart() to remove the start or trimend() to ...

Windows PowerShellPowerTipguest blogger