Skip to content

Fix typos and high-confidence correctness bugs - #40

Merged
lazywinadmin merged 1 commit into
masterfrom
fix/typos-and-correctness
Sep 3, 2026
Merged

Fix typos and high-confidence correctness bugs#40
lazywinadmin merged 1 commit into
masterfrom
fix/typos-and-correctness

Conversation

@lazywinadmin

Copy link
Copy Markdown
Owner

Summary

Typos in user-visible help/comments/Write-* plus a small set of high-confidence correctness bugs. No restyle, no public function renames, no output-property renames.

This is a script collection, not a module. No tests were run (the repo has no CI).

Typos

File Change
TOOL-Send-Email/TOOL-Send-Email.ps1 attachement→attachment, delivey→delivery, Attachement Parameter→Attachment Parameter, Credential Paramenter→Credential Parameter
AD-USER-Report_Expiring_users/AD-USER-Report_Expiring_users.ps1 Attachement→Attachment, Paramenter→Parameter
TOOL-New-Password/New-Password.ps1 Upercase→Uppercase
TOOL-New-DjoinFile/New-DjoinFile.ps1 provisionned→provisioned
TOOL-Get-PendingReboot/Get-PendingReboot.ps1 consistant→consistent
AD-SITE-Find_Missing_Subnets/AD-Find_missing_subnets_in_ActiveDirectory.ps1 colomn→column
AZURE-Get-AzureIPRangesAndServiceTags/Get-AzureIPRangesAndServiceTags.ps1 Germnay→Germany, Converfrom-json→ConvertFrom-Json
AZURE-Policy-Invoke-ComplianceEvaluation/Invoke-ComplianceEvaluation.ps1 evalution→evaluation
TOOL-New-CimSmartSession/New-CimSmartSession.ps1 containter→container
TOOL-Get-LocalGroupMember/Get-LocalGroupMember.ps1 Resurce→Resource
TOOL-Set-NetworkLevelAuthentication/Set-NetworkLevelAuthentication.ps1 CIM/WIM→CIM/WMI, CLeanup→Cleanup
AD-COMPUTER-Get-DomainComputer/Get-DomainComputer.ps1 “how many result you want” → “how many results you want”; “parameter allow you” → “parameter allows you”
AD-SITE-Add-ADSubnet(ADSI)/Add-ADSubnet.ps1 “This function allow you” → “allows you”
AD-USER-Get-ADDirectReport/Get-ADDirectReport.ps1 retrieve→retrieves; the specify account→the specified account
AD-GPO-Get-ADGPOReplication/AD-GPO-Get-ADGPOReplication.ps1 retrieve one or all the GPO → retrieves one or all GPOs
AD-GPO-Get-ADGPOReplication/README.MD accross→across
TOOL-Get-ComputerInfo/Get-ComputerInfo.ps1 “This function as been tested” → “has been tested”
TOOL-Enable-RemoteDesktop/Enable-RemoteDesktop.ps1, TOOL-Disable-RemoteDesktop/Disable-RemoteDesktop.ps1, TOOL-Get-Uptime/Get-Uptime.ps1 Write-Warning -MEssage-Message
_Template/Get-Something.ps1, AD-FSMO-Get-ADFSMORole/AD-FSMO-Get-ADFSMORole.ps1 dummy date 2016/00/00 → 2016/01/01
_Profiles/Microsoft.PowerShell_profile.ps1 “commands in my story” → “history”
AD-SITE-Get-ADSiteInventory/Get-ADSiteInventory.ps1 leftover comment PSoBject → PSObject
AD-SITE-Get-ADSIComputerSite/Get-ADSIComputerSite.ps1 examples Get-ADSIComputerName → Get-ADSIComputerSite
AD-USER-Get-AccountLockedOut/AD-USER-Get-AccountLockedOut.ps1 .PARAMETER UserName no longer copies DomainName help
SCCM-Get-SCCMClientCacheInformation/Get-SCCMClientCacheInformation.ps1 dropped copied “not the service restart” sentence from Credential help; execptionException
TOOL-Test-RemoteDesktopIsEnabled/Test-RemoteDesktopIsEnabled.ps1 comment “# Enable Remote Desktop” → “# Read AllowTsConnections”
AZURE-AppService-Update_RestrictionIP/AppService-Update_RestrictionIP.ps1 “only validate” → “only validates”; “to defined if” → “to determine if”
SCCM-Set-SCCMClientCacheSize/Set-SCCMClientCacheSize.ps1 $Error[0].execption.message.Exception.Message

Correctness

  • SCCM-Set-SCCMClientCacheLocation/Set-SCCMClientCacheLocation.ps1: [int]$Location[string]$Location so the documented path example binds; comment “Set the Cache Size” → “Set the Cache Location”; added [CmdletBinding(SupportsShouldProcess)] and wrapped the mutating $Cache.location / $Cache.Put() in ShouldProcess.
  • AD-GROUP-Get-ParentGroup/AD-GROUP-Get-ParentGroup.ps1: recursive call was Get-ParentGroup -OutBuffer ... (common parameter); now Get-ParentGroup -Name $CurrentObject.DistinguishedName. Help block rewritten so synopsis/examples describe parent groups (was a copy of Get-NestedMember). Visited-set for circular membership not added in this PR.
  • AD-OBJECT-Get-ADSITokenGroup/Get-ADSITokenGroup.ps1: removed undefined $DomainDN. SearchRoot is no longer overwritten with the default DN after applying credentials. SearchRoot is set from DomainDistinguishedName only when the caller passed that parameter (PSBoundParameters). If both Credential and Domain are set, DirectoryEntry is bound after the LDAP path is normalized.
  • TOOL-New-CimSmartSession/New-CimSmartSession.ps1: DCOM fallback New-CimSession @SessionParams@CIMSessionSplatting. Cleanup now removes 'SessionOption' (the actual hashtable key).
  • TOOL-Out-Excel/Out-Excel.ps1: assign $thisColumn = $HeaderHash[$header] before writing the cell; add [Parameter(ValueFromPipeline)] [psobject]$InputObject and use $InputObject instead of unbound $_. Excel COM approach otherwise unchanged.
  • AD-GROUP-Get-NestedMember/AD-GROUP-Get-NestedMember.ps1: recurse when MaxDepth is omitted/0 or $DepthCount -lt $MaxDepth; pass incremented depth into the recursive call. Default remains unlimited when -MaxDepth is omitted.
  • TOOL-Sync-Wsus-Client/Sync-WsusClient.ps1: define $criteria = "IsInstalled=0" before Search($criteria); add [CmdletBinding()]. wuauclt left as-is.
  • [CmdletBinding()] added so $PSCmdlet.ThrowTerminatingError works on: EXCHANGE-Connect-ExchangeOnPremises/Connect-ExchangeOnPremises.ps1, EXCHANGE-Connect-ExchangeOnline/Connect-ExchangeOnline.ps1, TOOL-Test-RemoteDesktopIsEnabled/Test-RemoteDesktopIsEnabled.ps1, SCCM-Set-SCCMClientCacheLocation/Set-SCCMClientCacheLocation.ps1 (via SupportsShouldProcess above).
  • TOOL-Expand-GzipFile/Expand-GzipFile.ps1: stream Close() moved into finally (throw previously made Close unreachable).
  • TOOL-Clean-MacAddress/Clean-MacAddress.ps1: -replace "/s"-replace "\s". Function name unchanged.

Intentionally NOT done

  • Did not remove TOOL-Start-KeyLogger (follow-up / security PR).
  • Did not rewrite Exchange/O365 Basic-auth connectors (only added [CmdletBinding()] so CATCH does not throw on $PSCmdlet).
  • Did not do a repo-wide SupportsShouldProcess sweep (only Set-SCCMClientCacheLocation, where the mutating assignment could be wrapped without a rewrite).
  • Did not rename public functions or output properties (kept Protocole as-is; kept Clean-MacAddress).
  • Did not delete tests/Add-LocalGroupMember.ps1 — it is not a real test and does not run; follow-up: finish it as a TOOL- function or remove it from tests/.
  • Did not add CI, LDAP escaping, CIM migrations, or credential-parameter hardening.
  • Did not add a visited-set to Get-ParentGroup (circular membership still possible).
  • Did not replace wuauclt in Sync-WsusClient.

Test plan

  • No automated tests (no CI in this repo).
  • Spot-check comment-based help on a few changed files (Get-Help / Get-Help -Examples).
  • Set-SCCMClientCacheLocation -Location "C:\temp\ccmcache" -WhatIf binds a string path.
  • Get-ParentGroup recursion uses -Name, not -OutBuffer.

Correct user-visible help/comment typos and a small set of high-confidence
bugs (undefined variables, inverted MaxDepth, missing CmdletBinding, wrong
parameter types) so documented examples and CATCH blocks can actually run.
@lazywinadmin
lazywinadmin merged commit 1a44455 into master Sep 3, 2026
@lazywinadmin
lazywinadmin deleted the fix/typos-and-correctness branch September 3, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant