[v0.2.0]
Added
-
Added core functions
-
configured
WinRegOpsas a dependant module -
Updated build file for release
-
Comment-based help documentation added for the following public functions:
Get-AllUserProfilesGet-OrphanedProfilesRemove-OrphanedProfilesRemove-SIDProfileGet-UserProfileFoldersGet-RegistryUserProfilesGet-UserFolders
-
Comment-based help documentation added for the following public functions:
New-UserProfileObjectRemove-RegistryKeyForSIDRemove-ProfilesForSIDsGet-RegistryKeyForSIDGet-SIDProfileInfoGet-ProfilePathFromSIDTest-FolderExistsTest-OrphanedProfileTest-SpecialAccount
-
Implemented and completed Unit Tests for private functions
-
Get-UserFolders-
Added error handling using a
try/catchblock to ensure that ifGet-ChildItem
fails (e.g., due to permission issues), the function logs an error message and
returns an empty array instead of throwing an unhandled exception. -
Implemented an
OutputTypeattribute for better PowerShell function introspection
and to clearly indicate that the function returns an array of[PSCustomObject].
-
-
Invoke-UserProfileAuditSupporting Functions:-
These supporting functions are now utilized within
Invoke-UserProfileAudit
to audit user profiles from both the file system and registry sources.-
Process-RegistryProfiles:- Processes profiles retrieved from the registry,
compares them with folder profiles, and identifies orphaned profiles.
- Processes profiles retrieved from the registry,
-
Process-FolderProfiles:- Processes user profiles from the folder system,
identifies those without corresponding registry entries, and marks them as orphaned.
- Processes user profiles from the folder system,
-
Test-ComputerReachability:- Encapsulates the common behavior of
Test-ComputerPingto check if a computer
is reachable before proceeding with operations like profile audits. This ensures
consistent handling of unreachable computers across different functions.
- Encapsulates the common behavior of
-
-
Changed
-
Moved
Get-SIDProfileInfoto the private functions folder. It will serve as
an internal function forGet-RegistryUserProfiles -
Get-SIDProfileInfo-
Returns an empty array
@()when no registry
key or SIDs are found, improving handling for cases where there are no profiles. -
Improved error handling to ensure proper error messages when the registry key
or subkeys cannot be opened. -
Enhanced handling of SIDs that are invalid or missing a
ProfileImagePath,
logging appropriate warnings or verbose messages. -
Optimized function behavior to handle scenarios with no SIDs, invalid SID formats,
and missingProfileImagePathvalues gracefully.
-
-
Get-UserFolders-
The function now logs errors when folder retrieval fails, improving diagnostic
feedback. -
The default value for the
ComputerNameparameter is set to$env:COMPUTERNAME,
ensuring local computer behavior by default without requiring the user to
specify it manually. -
Refined the
Get-DirectoryPathcall to ensure path conversion consistency
across local and remote environments. -
General code clean-up and improved resilience, returning an empty array when
no folders are found or in case of failure, rather than proceeding
without valid data.
-
-
Get-UserProfilesFromRegistry-
Added error handling using a
try-catchblock to capture and log errors
during the retrieval of registry profiles. -
Implemented a check using
Test-ComputerPingto verify if the target computer
is online or reachable before attempting to retrieve registry profiles. -
Returns an empty array
@()when the target computer is offline or unreachable,
logging a warning in such cases. -
Returns an empty array
@()when an error occurs while accessing the registry
profiles, logging an error message. -
Integrated with the
-ErrorAction Stopparameter when callingGet-SIDProfileInfo,
ensuring that errors are caught and handled appropriately in the calling function.
-
-
Get-UserProfilesFromFolders-
Added error handling using a
try-catchblock to capture and log errors
during the retrieval of user profile folders. -
Implemented a check using
Test-ComputerPingto verify if the target
computer is online or reachable before attempting to retrieve user folders. -
Returns an empty array
@()when the target computer is offline or
unreachable, logging a warning in such cases. -
Returns an empty array
@()when an error occurs while accessing the user
folders, logging an error message.
-
-
Invoke-UserProfileAudit- Renamed the previous
Get-AllUserProfilesfunction toInvoke-UserProfileAudit. - Added
Get-AllUserProfilesas an alias forInvoke-UserProfileAudit
to maintain backward compatibility.
- Renamed the previous
Removed
-
Removed the old
Get-AllUserProfilesfunction and replaced it with the new
Invoke-UserProfileAuditfunction. -
Temporarily Removed functions (
Remove-OrphanedProfilesand
Remove-ProfilesForSIDs) related to Removing Users Folders and registry
keys for further testing before implementing