Skip to content

Commit 46bbabe

Browse files
committed
Clean up tests and extra logging
1 parent 5047249 commit 46bbabe

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

src/code/InstallHelper.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -972,8 +972,6 @@ private bool TryInstallToTempPath(
972972
try
973973
{
974974
var pathToFile = Path.Combine(tempInstallPath, $"{pkgName}.{normalizedPkgVersion}.zip");
975-
_cmdletPassedIn.WriteVerbose($"pathToFile IS: {pathToFile}.");
976-
977975
using var fs = File.Create(pathToFile);
978976
responseStream.Seek(0, System.IO.SeekOrigin.Begin);
979977
responseStream.CopyTo(fs);
@@ -984,7 +982,6 @@ private bool TryInstallToTempPath(
984982
var tempDirNameVersion = Path.Combine(tempInstallPath, pkgName.ToLower(), pkgVersion);
985983

986984
Directory.CreateDirectory(tempDirNameVersion);
987-
988985
if (!TryExtractToDirectory(pathToFile, tempDirNameVersion, out error))
989986
{
990987
return false;

test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,7 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
146146
$pkg.Version | Should -Be "1.0.0"
147147

148148
Install-PSResource -Name $testModuleClobber2 -Repository $localRepo -TrustRepository -NoClobber -ErrorVariable ev -ErrorAction SilentlyContinue -verbose
149-
$pkg = Get-InstalledPSResource $testModuleClobber2 -ErrorAction SilentlyContinue
150-
151-
if (!$pkg) {
152-
# Get the first available module named 'clobbertestmodule1' and its exported commands
153-
$module2 = (Get-Module -ListAvailable $testModuleClobber2)[0]
154-
$module2Idx = $module[0]
155-
# Iterate through each exported command in the module
156-
foreach ($command in $module2Idx.ExportedCommands.Values) {
157-
# Output the command's name and details
158-
Write-Verbose -Verbose "Command Name: $($command.Name)"
159-
Write-Verbose -Verbose "Command Type: $($command.CommandType)"
160-
Write-Verbose -Verbose "----------------------------------"
161-
}
162-
}
163-
149+
$pkg = Get-InstalledPSResource $testModuleClobber2 -ErrorAction SilentlyContinue}
164150
$pkg | Should -BeNullOrEmpty
165151
$ev.Count | Should -Be 1
166152
$ev[0] | Should -Be "'testModuleClobber2' package could not be installed with error: The following commands are already available on this system: 'Test-Cmdlet1, Test-Cmdlet1'. This module 'testModuleClobber2' may override the existing commands. If you still want to install this module 'testModuleClobber2', remove the -NoClobber parameter."

0 commit comments

Comments
 (0)