diff --git a/dependencies.txt b/dependencies.txt index 91d257e..8ef5b09 100644 Binary files a/dependencies.txt and b/dependencies.txt differ diff --git a/restore/Restore-Dependencies.ps1 b/restore/Restore-Dependencies.ps1 index 80df47d..3bb81eb 100644 --- a/restore/Restore-Dependencies.ps1 +++ b/restore/Restore-Dependencies.ps1 @@ -51,7 +51,11 @@ param( # Check for privileges (Windows only) [switch]$CheckForDeveloperMode= $true, # Default is $true [switch]$CheckForSymbolicLinkPermissions= $true, # Default is $true - [switch]$CheckForAdminOnly= $false # Default is $false + [switch]$CheckForAdminOnly= $false, # Default is $false + + # Set the Write-Host message behavior + [switch]$Verbose= $false, # Default is $false + [switch]$DebugMsg= $false # Default is $false ) # Global Variables @@ -63,9 +67,7 @@ $Auto_Use_mklink_To_Create_SymLinks = $false # Default is $false # Ignore the permissions to create symbolic links with 'New-Item' and use mklink to create symbolic links. $Force_Use_mklink_To_Create_SymLinks = $true # Default is $true. If $Auto_Use_mklink_To_Create_SymLinks is $true, this variable is ignored. -# Set the Write-Host message behavior -[switch]$Verbose= $false # Default is $false -[switch]$DebugMsg= $false # Default is $false + function Test-Administrator { return (([Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole('Administrators')).If($true, $false) @@ -239,7 +241,17 @@ function ProcessDependencies($DependenciesFile) { # Extract the project name from the URL $urlParts = $url -split '/' $projectNameWithExtension = $urlParts[-1] - $projectName = $projectNameWithExtension -split '\.' | Select-Object -First 1 + # Assuming the project name is the same as the repository name, and considering the possibility of a .git extension to fix a 'dot' in the project name. + # Get the index of the last dot in the string (.git) + $lastDotPosition = $projectNameWithExtension.LastIndexOf('.') + # Check if a dot was found + if ($lastDotPosition -ge 0) { + # Extract the substring without the last dot + $projectName = $projectNameWithExtension.Substring(0, $lastDotPosition) + } else { + # No dot found, use the entire string as the project name! + $projectName = $projectNameWithExtension + } # Create a custom object for the project [PSCustomObject]@{ "Hash" = $hash