# Tag Info

Accepted

• 81

### Power-Guessing The Number

I have three points to make: GetNumber: The naming indicates it may be for integer conversion. While the truth is far from that, renaming might be a good idea. ...
• 11.9k
Accepted

### Power-Guessing The Number

Needs more variables I see plenty of integer constants. They define the upper and lower bounds of the game. Let turn those into variables and define them. Makes the game easier to make changes. <...
• 2,548

### Remove known Excel passwords with PowerShell

Once you've found the right password and moved the file, then there is no need to try the rest of the passwords on it. You can break out of the loop with a break ...
• 1,663

### MD5 hash comparison for two folders

Better is subjective but I will try and improve the code your have here to make it more robust and scalable. I will try to cover areas of improvement or focus and bring it together in the end. A lot ...
• 2,548
Accepted

### Powershell to quickly ping a number of machines

Want to start of with I am new to workflows as well. For the most part your code is solid. You should see a couple of suggestions that would actually improve performance especially if you are running ...
• 2,548

### Getting a list of all computer objects in each AD domain

One thing that I notice, you can change this repetitive fragment ...
• 211
Accepted

### Powershell to Convert HTML Table to Array of PSCustomObject

Parsing HTML I won't lay into you too badly about using RegEx on HTML since you clearly already know it's a bad idea and are trying to parse it as XML instead. Not a bad idea. I have to recommend ...
• 1,769

### Find related groups among list of users

Purposeful PowerShell Help I see that you have some comments in your script. Those for the most part would be hidden inside the script and the only way someone would see them is to open it. This may ...
• 2,548

### Adding some properties to an Active Directory user

Disclaimer: I never wrote code like that, I do not see a reason to do it and I discourage everyone to do it. This however may be seen as nothing else aside of a preference. But what are you trying to ...
• 5,536

### PowerShell script to create Excel spreadsheet from HTML file

Your code looks fine. Just some notes: Excel The main weakness of your design as I see it is its reliance on the Excel application. Since you say robustness is important, Excel would be the main ...
• 1,663
Accepted

### Fastest Windows script to move files from one did to a network dir

Okay, I'll start by trying to answer your questions first. If there is a lot of files and you should look into using runspaces to run several copy-jobs in separate threads. Just be careful, you are ...
• 166
Accepted

### Query AD and build CSV based on certain user object properties

There are several changes I would propose here. I will try and tackle them one an a time. I will include some snippets as we go along but the end will contain the whole code. Redundant call to Get-...
• 2,548
Accepted

### FizzBuzz: A PowerShell Story

Your code looks good to me. I like how it takes pipelined input. That is pretty elegant. You don't need the Position=0 here: ...
• 1,663
Accepted

### Creating a portable encrypted credential store

I don't know enough about handling credentials to know whether the overall concept is sound, so I will ignore that aspect. I do have the following suggestions regarding the details of your code. Use ...
• 166

### Sherlock is going against the Beast with PowerShell

I'm no powershell expert but if spaces sprinkled around here and there would make the code more readable. So instead of this: ...
• 20.1k
Accepted

### Get AD Users' Latest Last Logon Dates across Multiple DCs

Aliases You're used to my reviews by now so you're probably tired of me saying this, but avoid aliases and abbreviations (% vs ...
• 1,769

### Batch script to make folders hidden

I am glad you asked your question here. I'm hoping to explain why what you are trying to do is a bad idea. I cannot speak much for improving your batch as that is not my strong point but that should ...
• 2,548
Accepted

### Cleanly setting ACLs

To streamline the permission handling you may want to wrap ACE creation in a function and set the ACL just once at after all ACEs were added: ...
Accepted

### Populate Comboboxes with Hashtables using PowerShell

The first thing to observe is that the five pieces of code are identical except for two parameters that are varying. We can capture the common the code in a function (let's call it ...
• 1,663
Accepted

### Settings JAVA_HOME with Powershell

For a beginner script there are some There might be more to cover but there are a few things here that could improve the script. Variable and function naming In general functions and cmdlets should ...
• 2,548
Accepted

### Normalize video filenames and move files to destination directory

Get-ChildItem -include *.ext1, *.ext2 instead of Where Use pipelining via | (in direct ...
• 1,952
Accepted

### Arp-spoof check in PowerShell

split and spread to variables: $IP,$SubnetBits = \$Subnet -split '/' your user-function invocation with parentheses is incorrect and works only for single ...
• 1,952
Accepted

### Powershell script to verify Linux-generated md5sum file

here are a few changes i would make. [grin] the ideas ... use Get-Content instead of ReadLines() the speed difference is not ...
• 296
Accepted

### Terminating an Active Directory user

Prompting for confirmation The way you're doing the prompt is overly complicated. Consider this: ...
• 1,769

### Delete folder if it exists in PowerShell

This will delete an empty folder as well and still propagates errors if files cannot be deleted ...
• 141