Fix typos and high-confidence correctness bugs - #40
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
TOOL-Send-Email/TOOL-Send-Email.ps1AD-USER-Report_Expiring_users/AD-USER-Report_Expiring_users.ps1TOOL-New-Password/New-Password.ps1TOOL-New-DjoinFile/New-DjoinFile.ps1TOOL-Get-PendingReboot/Get-PendingReboot.ps1AD-SITE-Find_Missing_Subnets/AD-Find_missing_subnets_in_ActiveDirectory.ps1AZURE-Get-AzureIPRangesAndServiceTags/Get-AzureIPRangesAndServiceTags.ps1AZURE-Policy-Invoke-ComplianceEvaluation/Invoke-ComplianceEvaluation.ps1TOOL-New-CimSmartSession/New-CimSmartSession.ps1TOOL-Get-LocalGroupMember/Get-LocalGroupMember.ps1TOOL-Set-NetworkLevelAuthentication/Set-NetworkLevelAuthentication.ps1AD-COMPUTER-Get-DomainComputer/Get-DomainComputer.ps1AD-SITE-Add-ADSubnet(ADSI)/Add-ADSubnet.ps1AD-USER-Get-ADDirectReport/Get-ADDirectReport.ps1AD-GPO-Get-ADGPOReplication/AD-GPO-Get-ADGPOReplication.ps1AD-GPO-Get-ADGPOReplication/README.MDTOOL-Get-ComputerInfo/Get-ComputerInfo.ps1TOOL-Enable-RemoteDesktop/Enable-RemoteDesktop.ps1,TOOL-Disable-RemoteDesktop/Disable-RemoteDesktop.ps1,TOOL-Get-Uptime/Get-Uptime.ps1Write-Warning -MEssage→-Message_Template/Get-Something.ps1,AD-FSMO-Get-ADFSMORole/AD-FSMO-Get-ADFSMORole.ps1_Profiles/Microsoft.PowerShell_profile.ps1AD-SITE-Get-ADSiteInventory/Get-ADSiteInventory.ps1AD-SITE-Get-ADSIComputerSite/Get-ADSIComputerSite.ps1AD-USER-Get-AccountLockedOut/AD-USER-Get-AccountLockedOut.ps1.PARAMETER UserNameno longer copies DomainName helpSCCM-Get-SCCMClientCacheInformation/Get-SCCMClientCacheInformation.ps1execption→ExceptionTOOL-Test-RemoteDesktopIsEnabled/Test-RemoteDesktopIsEnabled.ps1AZURE-AppService-Update_RestrictionIP/AppService-Update_RestrictionIP.ps1SCCM-Set-SCCMClientCacheSize/Set-SCCMClientCacheSize.ps1$Error[0].execption.message→.Exception.MessageCorrectness
SCCM-Set-SCCMClientCacheLocation/Set-SCCMClientCacheLocation.ps1:[int]$Location→[string]$Locationso 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()inShouldProcess.AD-GROUP-Get-ParentGroup/AD-GROUP-Get-ParentGroup.ps1: recursive call wasGet-ParentGroup -OutBuffer ...(common parameter); nowGet-ParentGroup -Name $CurrentObject.DistinguishedName. Help block rewritten so synopsis/examples describe parent groups (was a copy ofGet-NestedMember). Visited-set for circular membership not added in this PR.AD-OBJECT-Get-ADSITokenGroup/Get-ADSITokenGroup.ps1: removed undefined$DomainDN.SearchRootis no longer overwritten with the default DN after applying credentials.SearchRootis set fromDomainDistinguishedNameonly when the caller passed that parameter (PSBoundParameters). If both Credential and Domain are set,DirectoryEntryis bound after the LDAP path is normalized.TOOL-New-CimSmartSession/New-CimSmartSession.ps1: DCOM fallbackNew-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]$InputObjectand use$InputObjectinstead of unbound$_. Excel COM approach otherwise unchanged.AD-GROUP-Get-NestedMember/AD-GROUP-Get-NestedMember.ps1: recurse whenMaxDepthis omitted/0 or$DepthCount -lt $MaxDepth; pass incremented depth into the recursive call. Default remains unlimited when-MaxDepthis omitted.TOOL-Sync-Wsus-Client/Sync-WsusClient.ps1: define$criteria = "IsInstalled=0"beforeSearch($criteria); add[CmdletBinding()].wuaucltleft as-is.[CmdletBinding()]added so$PSCmdlet.ThrowTerminatingErrorworks 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: streamClose()moved intofinally(throwpreviously made Close unreachable).TOOL-Clean-MacAddress/Clean-MacAddress.ps1:-replace "/s"→-replace "\s". Function name unchanged.Intentionally NOT done
TOOL-Start-KeyLogger(follow-up / security PR).[CmdletBinding()]so CATCH does not throw on$PSCmdlet).SupportsShouldProcesssweep (onlySet-SCCMClientCacheLocation, where the mutating assignment could be wrapped without a rewrite).Protocoleas-is; keptClean-MacAddress).tests/Add-LocalGroupMember.ps1— it is not a real test and does not run; follow-up: finish it as aTOOL-function or remove it fromtests/.Get-ParentGroup(circular membership still possible).wuaucltinSync-WsusClient.Test plan
Get-Help/Get-Help -Examples).Set-SCCMClientCacheLocation -Location "C:\temp\ccmcache" -WhatIfbinds a string path.Get-ParentGrouprecursion uses-Name, not-OutBuffer.