Showing category results for PowerTip

Jun 29, 2016
Post comments count0
Post likes count0

PowerTip: List all available CIM classes by using PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the Get-CimClass cmdlet to see all classes that you can query from. How can I find a list of Common Information Model (CIM) classes in Windows so that I can ask my computer useful questions? Just run the Get-CIMClass cmdlet to get a list of all available classes in the default namespace in Windows. If you’d like to filter on the lis...

Windows PowerShellPowerTipguest blogger
Jun 28, 2016
Post comments count0
Post likes count0

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 27, 2016
Post comments count0
Post likes count0

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 24, 2016
Post comments count0
Post likes count0

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
Jun 23, 2016
Post comments count0
Post likes count0

PowerTip: Set the color of the progress bar with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use the $Host object to alter the color of the progress bar in PowerShell. I was curious if there’s a way to change the color of the progress bar in PowerShell. Do you know how this could be done? Glad you asked! You can do this by altering the values for ProgressBackGroundColor and ProgressForegroundColor under $Host.PrivateData. To ch...

Windows PowerShellPowerTipguest blogger