Please help improve my style

Hey Guy, Long time lurker, first time poster. I’m a self taught programmer and I’m looking to improve my style. I’ve started writing programs to help with my day-to-day work and, although functional, my programming style is…. inelegant. It works, but i know i need to improve. Here is a link to one of my […]

Help setting a local user account ‘user cannot change password’ ?

Note – user is a member of Administrators I’m trying something like this which is not working (Generic Failure, InvalidOperation): Get-WmiObject -Class Win32_UserAccount -Filter “LocalAccount=TRUE and Name=’$username'” | Set-WmiInstance -Arguments @{PasswordChangeable = $FALSE} I can run the same code but instead set @{PasswordExpires = $FALSE} and that works fine. Anyone have an idea? Hoping there’s […]

Hash table from registry key

I have a registry key (e.g. HKLM:SoftwareSomeApp) that has a bunch of REG_SZ under it. I need to get all of the string names and values into a hash table. I found an old Scripting Guy blog post (https://blogs.technet.microsoft.com/heyscriptingguy/2012/05/11/use-powershell-to-enumerate-registry-property-values/) about getting an array. That’s…okay, but every method I’ve tried to convert it to a hash […]