TheTaylorLee / AdminToolbox

Repository for the AdminToolbox PowerShell Modules
MIT License
191 stars 23 forks source link

Function name Get-FolderSize already exists in module PSFolderSize #88

Closed eizedev closed 2 years ago

eizedev commented 2 years ago

Environment

Describe the bug The name of the function Get-FolderSize is the same as the name of the function in the module PSFolderSize

get-command Get-FolderSize

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-FolderSize                                     1.7.1      PSFolderSize

Expected behavior Can you please rename your function? Alternatively, after renaming you could also check during the import if a function with the name Get-FolderSize already exists locally and if not set an alias to Get-FolderSize.
This allows existing users of AdminToolbox.FileManagement to simply continue using the feature.

Error Message Install-Package: The following commands are already available on this system:'Get-FolderSize'. This module 'AdminToolbox.FileManagement' may override the existing commands. If you still want to install this module 'AdminToolbox.FileManagement', use -AllowClobber parameter.

Additional context None

Thanks, René

TheTaylorLee commented 2 years ago

Get-Foldersize is not a function that exist for any native PowerShell modules that I have seen. You likely are running into clobber with another module you have downloaded. You can find that conflict by using get-module -listavailable.

Options to get around it are to use -allowclobber & -prefix parameters on import or remove the other module.

I will not be modifying the function name.