Quantcast
Channel: @DoctorDNS – PowerShell Community
Browsing all 18 articles
Browse latest View live

Changing Drive Letters and Labels via PowerShell

Q: I want to change the drive letter and the drive label for a new USB drive. Is there a way with PowerShell? A: Of course. One way is to use WMI and the CIM cmdlets. PowerShell does not have a cmdlet...

View Article



Getting Yesterday’s Date

Q: How can I get yesterday’s date? A: You can use a combination of the Get-Date cmdlet and .NET Time/Date methods. First, let’s look at dates in PowerShell and .NET Then we can look at how to calculate...

View Article

Reading a text file bottom up

Q: I have a log file in which new data is appended to the end of the file. That means the most recent entries are at the end of the file. I’d like to be able to read the file starting with the last...

View Article

Can I Enable the Caps Lock Key?

Q: I have a script where users enter some information. This information needs to be entered in all capital letters, so my instructions say, “Please make sure the Caps Lock key is on before entering the...

View Article

Testing the connection to computers in the Active Directory

Q: As an administrator, I often have to do a lot of reporting on the servers in my domain. Is there a simple way to test the connection to every server in my domain or every server or client host in a...

View Article


Is a User a Local Administrator?

Q: Some of the things we do in our logon scripts require the user to be a local administrator. How can the script tell if the user is a local administrator or not, using PowerShell 7. A: Easy using...

View Article

How Do I Discover Changes to an AD Group’s Membership

Q: Is there an easy way to detect and changes to important the membership of AD Groups? A: Easy using PowerShell 7, WMI, and the CIM Cmdlets. WMI Windows Management Instrumentation (WMI) is an...

View Article

Image may be NSFW.
Clik here to view.

How to send output to a file

Q: Is there an easy way to save my script output to a text file rather than displaying it on screen? A: Of course – there are multiple ways to do just that! PowerShell and Output One of PowerShell’s...

View Article


How to rename a NIC

Q: Is there a simple way to rename a NIC, especially inside a Hyper-V VM? A: You can change the name of any Windows NIC using PowerShell – whether the NIC is in a physical host or a Hyper-V VM. NICS...

View Article


Image may be NSFW.
Clik here to view.

How to Change the Start Page for the Edge Browser

Q: How can I change the Edge startup page? A: You can change the start page easily using PowerShell. Edge and It’s Start Page I am basing this article on the latest incarnation of the Edge browser, aka...

View Article

How to Update or Add a Registry Key Value with PowerShell

Q: I am having a problem trying to update the registry. I am using the New-ItemProperty cmdlet, but it fails if the registry key does not exist. I added the –Force parameter, but it still does not...

View Article

How to Make Use Of PowerShell Profile Files

Q: I would like to personalize the way that PowerShell works. I have heard that I can use a thing called a profile to do this, but when I try to find information about profiles, I come up blank. There...

View Article

Getting Yesterday’s Date

Q: How can I get yesterday’s date? A: You can use a combination of the Get-Date cmdlet and .NET Time/Date methods. First, let’s look at dates in PowerShell and .NET Then we can look at how to calculate...

View Article


How to Make Use Of PowerShell Profile Files

Q: I would like to personalize the way that PowerShell works. I have heard that I can use a thing called a profile to do this, but when I try to find information about profiles, I come up blank. There...

View Article

How to use the Secret modules

Q: I have a bunch of scripts we use in production that make use of Windows credentials. In some cases, these scripts have an actual password in plain text, while others read the password from an XML...

View Article


How to Use $FormatEnumerationLimit

Q: When I format an object where a property contains more than 4 objects, I never see the extra property values. How can I fix that? A: Use the $FormatEnumerationLimit variable. This query is one I...

View Article

How to Use $PSDefaultParameterValues

Q: When I use cmdlets like Receive-Job and Format-Table, how do I change default values of the Keep and Wrap parameters? A: Use the $PSDefaultValues automatic variable. When I first discovered...

View Article


Image may be NSFW.
Clik here to view.

How to Preview PowerShell Scripts In PowerShell

Q: When I use Windows Explorer and select a PowerShell script file – I do not see the script in the preview window. Can I fix that? A: You can make a few simple registry updates and do just what you...

View Article
Browsing all 18 articles
Browse latest View live




Latest Images