diff --git a/src/code/FindHelper.cs b/src/code/FindHelper.cs index a8b942dd3..460054b45 100644 --- a/src/code/FindHelper.cs +++ b/src/code/FindHelper.cs @@ -110,12 +110,12 @@ public IEnumerable FindByResourceName( PSRepositoryInfo psGalleryScripts = new PSRepositoryInfo(_psGalleryScriptsRepoName, psGalleryScriptsUrl, repositoriesToSearch[i].Priority, false); if (_type == ResourceType.None) { - _cmdletPassedIn.WriteDebug("Null Type provided, so add PSGalleryScripts repository"); + _cmdletPassedIn.WriteVerbose("Null Type provided, so add PSGalleryScripts repository"); repositoriesToSearch.Insert(i + 1, psGalleryScripts); } else if (_type != ResourceType.None && _type == ResourceType.Script) { - _cmdletPassedIn.WriteDebug("Type Script provided, so add PSGalleryScripts and remove PSGallery (Modules only)"); + _cmdletPassedIn.WriteVerbose("Type Script provided, so add PSGalleryScripts and remove PSGallery (Modules only)"); repositoriesToSearch.Insert(i + 1, psGalleryScripts); repositoriesToSearch.RemoveAt(i); // remove PSGallery } @@ -124,7 +124,7 @@ public IEnumerable FindByResourceName( for (int i = 0; i < repositoriesToSearch.Count && _pkgsLeftToFind.Any(); i++) { - _cmdletPassedIn.WriteDebug(string.Format("Searching in repository {0}", repositoriesToSearch[i].Name)); + _cmdletPassedIn.WriteVerbose(string.Format("Searching in repository {0}", repositoriesToSearch[i].Name)); foreach (var pkg in SearchFromRepository( repositoryName: repositoriesToSearch[i].Name, repositoryUrl: repositoriesToSearch[i].Url)) @@ -224,7 +224,7 @@ public IEnumerable SearchAcrossNamesInRepository( { if (String.IsNullOrWhiteSpace(pkgName)) { - _cmdletPassedIn.WriteDebug(String.Format("Package name: {0} provided was null or whitespace, so name was skipped in search.", + _cmdletPassedIn.WriteVerbose(String.Format("Package name: {0} provided was null or whitespace, so name was skipped in search.", pkgName == null ? "null string" : pkgName)); continue; } diff --git a/src/code/GetHelper.cs b/src/code/GetHelper.cs index b451f3227..18cd5ab29 100644 --- a/src/code/GetHelper.cs +++ b/src/code/GetHelper.cs @@ -86,7 +86,7 @@ public IEnumerable FilterPkgPathsByVersion(VersionRange versionRange, Li // if no version is specified, just get the latest version foreach (string pkgPath in dirsToSearch) { - _cmdletPassedIn.WriteDebug(string.Format("Searching through package path: '{0}'", pkgPath)); + _cmdletPassedIn.WriteVerbose(string.Format("Searching through package path: '{0}'", pkgPath)); // if this is a module directory if (Directory.Exists(pkgPath)) @@ -94,7 +94,7 @@ public IEnumerable FilterPkgPathsByVersion(VersionRange versionRange, Li // search modules paths // ./Modules/Test-Module/1.0.0 // ./Modules/Test-Module/2.0.0 - _cmdletPassedIn.WriteDebug(string.Format("Searching through package path: '{0}'", pkgPath)); + _cmdletPassedIn.WriteVerbose(string.Format("Searching through package path: '{0}'", pkgPath)); string[] versionsDirs = Utils.GetSubDirectories(pkgPath); @@ -111,7 +111,7 @@ public IEnumerable FilterPkgPathsByVersion(VersionRange versionRange, Li foreach (string versionPath in versionsDirs) { - _cmdletPassedIn.WriteDebug(string.Format("Searching through package version path: '{0}'", versionPath)); + _cmdletPassedIn.WriteVerbose(string.Format("Searching through package version path: '{0}'", versionPath)); DirectoryInfo dirInfo = new DirectoryInfo(versionPath); // if the version is not valid, we'll just skip it and output a debug message diff --git a/src/code/GetInstalledPSResource.cs b/src/code/GetInstalledPSResource.cs index 7928c6e4c..34ac306d1 100644 --- a/src/code/GetInstalledPSResource.cs +++ b/src/code/GetInstalledPSResource.cs @@ -71,7 +71,7 @@ protected override void BeginProcessing() _pathsToSearch = new List(); if (Path != null) { - WriteDebug(string.Format("Provided path is: '{0}'", Path)); + WriteVerbose(string.Format("Provided path is: '{0}'", Path)); var resolvedPaths = SessionState.Path.GetResolvedPSPathFromPSPath(Path); if (resolvedPaths.Count != 1) @@ -85,7 +85,7 @@ protected override void BeginProcessing() } var resolvedPath = resolvedPaths[0].Path; - WriteDebug(string.Format("Provided resolved path is '{0}'", resolvedPath)); + WriteVerbose(string.Format("Provided resolved path is '{0}'", resolvedPath)); var versionPaths = Utils.GetSubDirectories(resolvedPath); if (versionPaths.Length == 0) @@ -110,7 +110,7 @@ protected override void BeginProcessing() protected override void ProcessRecord() { - WriteDebug("Entering GetInstalledPSResource"); + WriteVerbose("Entering GetInstalledPSResource"); var namesToSearch = Utils.ProcessNameWildcards(Name, out string[] errorMsgs, out bool _); foreach (string error in errorMsgs) diff --git a/src/code/GetPSResourceRepository.cs b/src/code/GetPSResourceRepository.cs index 05f168d58..9eb57b530 100644 --- a/src/code/GetPSResourceRepository.cs +++ b/src/code/GetPSResourceRepository.cs @@ -41,7 +41,7 @@ protected override void BeginProcessing() { try { - WriteDebug("Calling API to check repository store exists in non-corrupted state"); + WriteVerbose("Calling API to check repository store exists in non-corrupted state"); RepositorySettings.CheckRepositoryStore(); } catch (PSInvalidOperationException e) @@ -56,7 +56,7 @@ protected override void BeginProcessing() protected override void ProcessRecord() { string nameArrayAsString = (Name == null || !Name.Any() || string.Equals(Name[0], "*") || Name[0] == null) ? "all" : string.Join(", ", Name); - WriteDebug(String.Format("reading repository: {0}. Calling Read() API now", nameArrayAsString)); + WriteVerbose(String.Format("reading repository: {0}. Calling Read() API now", nameArrayAsString)); List items = RepositorySettings.Read(Name, out string[] errorList); // handle non-terminating errors diff --git a/src/code/InstallHelper.cs b/src/code/InstallHelper.cs index 87d624e9d..e59ab36f6 100644 --- a/src/code/InstallHelper.cs +++ b/src/code/InstallHelper.cs @@ -77,7 +77,7 @@ public void InstallPackages( bool includeXML, List pathsToInstallPkg) { - _cmdletPassedIn.WriteDebug(string.Format("Parameters passed in >>> Name: '{0}'; Version: '{1}'; Prerelease: '{2}'; Repository: '{3}'; " + + _cmdletPassedIn.WriteVerbose(string.Format("Parameters passed in >>> Name: '{0}'; Version: '{1}'; Prerelease: '{2}'; Repository: '{3}'; " + "AcceptLicense: '{4}'; Quiet: '{5}'; Reinstall: '{6}'; TrustRepository: '{7}'; NoClobber: '{8}';", string.Join(",", names), (versionRange != null ? versionRange.OriginalString : string.Empty), @@ -124,13 +124,13 @@ public void ProcessRepositories(string[] packageNames, string[] repository, bool var sourceTrusted = false; string repoName = repo.Name; - _cmdletPassedIn.WriteDebug(string.Format("Attempting to search for packages in '{0}'", repoName)); + _cmdletPassedIn.WriteVerbose(string.Format("Attempting to search for packages in '{0}'", repoName)); // Source is only trusted if it's set at the repository level to be trusted, -TrustRepository flag is true, -Force flag is true // OR the user issues trust interactively via console. if (repo.Trusted == false && !trustRepository && !_force) { - _cmdletPassedIn.WriteDebug("Checking if untrusted repository should be used"); + _cmdletPassedIn.WriteVerbose("Checking if untrusted repository should be used"); if (!(yesToAll || noToAll)) { @@ -146,7 +146,7 @@ public void ProcessRepositories(string[] packageNames, string[] repository, bool if (sourceTrusted || yesToAll) { - _cmdletPassedIn.WriteDebug("Untrusted repository accepted as trusted source."); + _cmdletPassedIn.WriteVerbose("Untrusted repository accepted as trusted source."); // If it can't find the pkg in one repository, it'll look for it in the next repo in the list var isLocalRepo = repo.Url.AbsoluteUri.StartsWith(Uri.UriSchemeFile + Uri.SchemeDelimiter, StringComparison.OrdinalIgnoreCase); @@ -279,7 +279,7 @@ private List InstallPackage(IEnumerable pkgsToInstall, s if (!NuGetVersion.TryParse(createFullVersion, out NuGetVersion pkgVersion)) { - _cmdletPassedIn.WriteDebug(string.Format("Error parsing package '{0}' version '{1}' into a NuGetVersion", p.Name, p.Version.ToString())); + _cmdletPassedIn.WriteVerbose(string.Format("Error parsing package '{0}' version '{1}' into a NuGetVersion", p.Name, p.Version.ToString())); continue; } var pkgIdentity = new PackageIdentity(p.Name, pkgVersion); @@ -350,7 +350,7 @@ private List InstallPackage(IEnumerable pkgsToInstall, s } catch (Exception e) { - _cmdletPassedIn.WriteDebug(string.Format("Error attempting download: '{0}'", e.Message)); + _cmdletPassedIn.WriteVerbose(string.Format("Error attempting download: '{0}'", e.Message)); } finally { @@ -359,7 +359,7 @@ private List InstallPackage(IEnumerable pkgsToInstall, s } } - _cmdletPassedIn.WriteDebug(string.Format("Successfully able to download package from source to: '{0}'", tempInstallPath)); + _cmdletPassedIn.WriteVerbose(string.Format("Successfully able to download package from source to: '{0}'", tempInstallPath)); // Prompt if module requires license acceptance (need to read info license acceptance info from the module manifest) // pkgIdentity.Version.Version gets the version without metadata or release labels. @@ -426,12 +426,12 @@ private List InstallPackage(IEnumerable pkgsToInstall, s } catch (Exception e) { - _cmdletPassedIn.WriteDebug(string.Format("Unable to successfully install package '{0}': '{1}'", p.Name, e.Message)); + _cmdletPassedIn.WriteVerbose(string.Format("Unable to successfully install package '{0}': '{1}'", p.Name, e.Message)); } finally { // Delete the temp directory and all its contents - _cmdletPassedIn.WriteDebug(string.Format("Attempting to delete '{0}'", tempInstallPath)); + _cmdletPassedIn.WriteVerbose(string.Format("Attempting to delete '{0}'", tempInstallPath)); if (Directory.Exists(tempInstallPath)) { Directory.Delete(tempInstallPath, true); @@ -551,32 +551,32 @@ private void DeleteExtraneousFiles(string tempInstallPath, PackageIdentity pkgId // Unforunately have to check if each file exists because it may or may not be there if (File.Exists(nupkgSHAToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", nupkgSHAToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", nupkgSHAToDelete)); File.Delete(nupkgSHAToDelete); } if (File.Exists(nuspecToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", nuspecToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", nuspecToDelete)); File.Delete(nuspecToDelete); } if (File.Exists(nupkgToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", nupkgToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", nupkgToDelete)); File.Delete(nupkgToDelete); } if (File.Exists(contentTypesToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", contentTypesToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", contentTypesToDelete)); File.Delete(contentTypesToDelete); } if (Directory.Exists(relsDirToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", relsDirToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", relsDirToDelete)); Directory.Delete(relsDirToDelete, true); } if (Directory.Exists(packageDirToDelete)) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting '{0}'", packageDirToDelete)); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting '{0}'", packageDirToDelete)); Directory.Delete(packageDirToDelete, true); } } @@ -611,26 +611,26 @@ private void MoveFilesIntoInstallPath( { // Need to delete old xml files because there can only be 1 per script var scriptXML = p.Name + "_InstalledScriptInfo.xml"; - _cmdletPassedIn.WriteDebug(string.Format("Checking if path '{0}' exists: ", File.Exists(Path.Combine(installPath, "InstalledScriptInfos", scriptXML)))); + _cmdletPassedIn.WriteVerbose(string.Format("Checking if path '{0}' exists: ", File.Exists(Path.Combine(installPath, "InstalledScriptInfos", scriptXML)))); if (File.Exists(Path.Combine(installPath, "InstalledScriptInfos", scriptXML))) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting script metadata XML")); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting script metadata XML")); File.Delete(Path.Combine(installPath, "InstalledScriptInfos", scriptXML)); } - _cmdletPassedIn.WriteDebug(string.Format("Moving '{0}' to '{1}'", Path.Combine(dirNameVersion, scriptXML), Path.Combine(installPath, "InstalledScriptInfos", scriptXML))); + _cmdletPassedIn.WriteVerbose(string.Format("Moving '{0}' to '{1}'", Path.Combine(dirNameVersion, scriptXML), Path.Combine(installPath, "InstalledScriptInfos", scriptXML))); Utils.MoveFiles(Path.Combine(dirNameVersion, scriptXML), Path.Combine(installPath, "InstalledScriptInfos", scriptXML)); // Need to delete old script file, if that exists - _cmdletPassedIn.WriteDebug(string.Format("Checking if path '{0}' exists: ", File.Exists(Path.Combine(finalModuleVersionDir, p.Name + ".ps1")))); + _cmdletPassedIn.WriteVerbose(string.Format("Checking if path '{0}' exists: ", File.Exists(Path.Combine(finalModuleVersionDir, p.Name + ".ps1")))); if (File.Exists(Path.Combine(finalModuleVersionDir, p.Name + ".ps1"))) { - _cmdletPassedIn.WriteDebug(string.Format("Deleting script file")); + _cmdletPassedIn.WriteVerbose(string.Format("Deleting script file")); File.Delete(Path.Combine(finalModuleVersionDir, p.Name + ".ps1")); } } - _cmdletPassedIn.WriteDebug(string.Format("Moving '{0}' to '{1}'", scriptPath, Path.Combine(finalModuleVersionDir, p.Name + ".ps1"))); + _cmdletPassedIn.WriteVerbose(string.Format("Moving '{0}' to '{1}'", scriptPath, Path.Combine(finalModuleVersionDir, p.Name + ".ps1"))); Utils.MoveFiles(scriptPath, Path.Combine(finalModuleVersionDir, p.Name + ".ps1")); } else @@ -638,23 +638,23 @@ private void MoveFilesIntoInstallPath( // If new path does not exist if (!Directory.Exists(newPathParent)) { - _cmdletPassedIn.WriteDebug(string.Format("Attempting to move '{0}' to '{1}'", tempModuleVersionDir, finalModuleVersionDir)); + _cmdletPassedIn.WriteVerbose(string.Format("Attempting to move '{0}' to '{1}'", tempModuleVersionDir, finalModuleVersionDir)); Directory.CreateDirectory(newPathParent); Utils.MoveDirectory(tempModuleVersionDir, finalModuleVersionDir); } else { - _cmdletPassedIn.WriteDebug(string.Format("Temporary module version directory is: '{0}'", tempModuleVersionDir)); + _cmdletPassedIn.WriteVerbose(string.Format("Temporary module version directory is: '{0}'", tempModuleVersionDir)); // At this point if if (Directory.Exists(finalModuleVersionDir)) { // Delete the directory path before replacing it with the new module - _cmdletPassedIn.WriteDebug(string.Format("Attempting to delete '{0}'", finalModuleVersionDir)); + _cmdletPassedIn.WriteVerbose(string.Format("Attempting to delete '{0}'", finalModuleVersionDir)); Directory.Delete(finalModuleVersionDir, true); } - _cmdletPassedIn.WriteDebug(string.Format("Attempting to move '{0}' to '{1}'", tempModuleVersionDir, finalModuleVersionDir)); + _cmdletPassedIn.WriteVerbose(string.Format("Attempting to move '{0}' to '{1}'", tempModuleVersionDir, finalModuleVersionDir)); Utils.MoveDirectory(tempModuleVersionDir, finalModuleVersionDir); } } diff --git a/src/code/PublishPSResource.cs b/src/code/PublishPSResource.cs index 0fb371bff..221f731dd 100644 --- a/src/code/PublishPSResource.cs +++ b/src/code/PublishPSResource.cs @@ -176,7 +176,7 @@ protected override void ProcessRecord() // TODO: think about including the repository the resource is being published to if (!ShouldProcess(string.Format("Publish resource '{0}' from the machine.", _path))) { - WriteDebug("ShouldProcess is set to false."); + WriteVerbose("ShouldProcess is set to false."); return; } @@ -287,7 +287,7 @@ protected override void ProcessRecord() if (string.IsNullOrEmpty(nuspec)) { // nuspec creation failed. - WriteDebug("Nuspec creation failed."); + WriteVerbose("Nuspec creation failed."); return; } @@ -371,7 +371,7 @@ protected override void ProcessRecord() PushNupkg(outputNupkgDir, repositoryUrl); } finally { - WriteDebug(string.Format("Deleting temporary directory '{0}'", outputDir)); + WriteVerbose(string.Format("Deleting temporary directory '{0}'", outputDir)); Directory.Delete(outputDir, recursive:true); } } @@ -620,7 +620,7 @@ private string CreateNuspec( metadataElement.AppendChild(element); } else { - WriteDebug(string.Format("Creating XML element failed. Unable to get value from key '{0}'.", key)); + WriteVerbose(string.Format("Creating XML element failed. Unable to get value from key '{0}'.", key)); } } @@ -812,11 +812,11 @@ private bool PackNupkg(string outputDir, string outputNupkgDir, string nuspecFil bool success = runner.RunPackageBuild(); if (success) { - WriteDebug("Successfully packed the resource into a .nupkg"); + WriteVerbose("Successfully packed the resource into a .nupkg"); } else { - WriteDebug("Successfully packed the resource into a .nupkg"); + WriteVerbose("Successfully packed the resource into a .nupkg"); } return success; diff --git a/src/code/RegisterPSResourceRepository.cs b/src/code/RegisterPSResourceRepository.cs index d019071c6..4ede96ae3 100644 --- a/src/code/RegisterPSResourceRepository.cs +++ b/src/code/RegisterPSResourceRepository.cs @@ -220,7 +220,7 @@ private PSRepositoryInfo AddToRepositoryStoreHelper(string repoName, Uri repoUrl throw new ArgumentException("Invalid url, must be one of the following Uri schemes: HTTPS, HTTP, FTP, File Based"); } - WriteDebug("All required values to add to repository provided, calling internal Add() API now"); + WriteVerbose("All required values to add to repository provided, calling internal Add() API now"); if (!ShouldProcess(repoName, "Register repository to repository store")) { return null; @@ -233,7 +233,7 @@ private PSRepositoryInfo NameParameterSetHelper(string repoName, Uri repoUrl, in { if (repoName.Equals("PSGallery", StringComparison.OrdinalIgnoreCase)) { - WriteDebug("Provided Name (NameParameterSet) but with invalid value of PSGallery"); + WriteVerbose("Provided Name (NameParameterSet) but with invalid value of PSGallery"); throw new ArgumentException("Cannot register PSGallery with -Name parameter. Try: Register-PSResourceRepository -PSGallery"); } @@ -243,7 +243,7 @@ private PSRepositoryInfo NameParameterSetHelper(string repoName, Uri repoUrl, in private PSRepositoryInfo PSGalleryParameterSetHelper(int repoPriority, bool repoTrusted) { Uri psGalleryUri = new Uri(PSGalleryRepoURL); - WriteDebug("(PSGallerySet) internal name and uri values for Add() API are hardcoded and validated, priority and trusted values, if passed in, also validated"); + WriteVerbose("(PSGallerySet) internal name and uri values for Add() API are hardcoded and validated, priority and trusted values, if passed in, also validated"); return AddToRepositoryStoreHelper(PSGalleryRepoName, psGalleryUri, repoPriority, repoTrusted); } @@ -266,7 +266,7 @@ private List RepositoriesParameterSetHelper() try { - WriteDebug("(RepositoriesParameterSet): on repo: PSGallery. Registers PSGallery repository"); + WriteVerbose("(RepositoriesParameterSet): on repo: PSGallery. Registers PSGallery repository"); reposAddedFromHashTable.Add(PSGalleryParameterSetHelper( repo.ContainsKey("Priority") ? (int)repo["Priority"] : defaultPriority, repo.ContainsKey("Trusted") ? (bool)repo["Trusted"] : defaultTrusted)); @@ -336,7 +336,7 @@ private PSRepositoryInfo RepoValidationHelper(Hashtable repo) try { - WriteDebug(String.Format("(RepositoriesParameterSet): on repo: {0}. Registers Name based repository", repo["Name"])); + WriteVerbose(String.Format("(RepositoriesParameterSet): on repo: {0}. Registers Name based repository", repo["Name"])); return NameParameterSetHelper(repo["Name"].ToString(), repoURL, repo.ContainsKey("Priority") ? Convert.ToInt32(repo["Priority"].ToString()) : defaultPriority, diff --git a/src/code/SetPSResourceRepository.cs b/src/code/SetPSResourceRepository.cs index 5f674f02f..d57588a32 100644 --- a/src/code/SetPSResourceRepository.cs +++ b/src/code/SetPSResourceRepository.cs @@ -97,7 +97,7 @@ protected override void BeginProcessing() { try { - WriteDebug("Calling API to check repository store exists in non-corrupted state"); + WriteVerbose("Calling API to check repository store exists in non-corrupted state"); RepositorySettings.CheckRepositoryStore(); } catch (PSInvalidOperationException e) @@ -200,7 +200,7 @@ private PSRepositoryInfo UpdateRepositoryStoreHelper(string repoName, Uri repoUr throw new ArgumentException("Either URL, Priority or Trusted parameters must be requested to be set"); } - WriteDebug("All required values to set repository provided, calling internal Update() API now"); + WriteVerbose("All required values to set repository provided, calling internal Update() API now"); if (!ShouldProcess(repoName, "Set repository's value(s) in repository store")) { return null; @@ -234,7 +234,7 @@ private List RepositoriesParameterSetHelper() private PSRepositoryInfo RepoValidationHelper(Hashtable repo) { - WriteDebug(String.Format("Parsing through repository: {0}", repo["Name"])); + WriteVerbose(String.Format("Parsing through repository: {0}", repo["Name"])); Uri repoURL = null; if (repo.ContainsKey("Url")) diff --git a/src/code/UninstallPSResource.cs b/src/code/UninstallPSResource.cs index 5081d039b..e38cd7533 100644 --- a/src/code/UninstallPSResource.cs +++ b/src/code/UninstallPSResource.cs @@ -105,7 +105,7 @@ protected override void ProcessRecord() if (!UninstallPkgHelper()) { // any errors should be caught lower in the stack, this debug statement will let us know if there was an unusual failure - WriteDebug("Did not successfully uninstall all packages"); + WriteVerbose("Did not successfully uninstall all packages"); } break; @@ -140,7 +140,7 @@ protected override void ProcessRecord() break; default: - WriteDebug("Invalid parameter set"); + WriteVerbose("Invalid parameter set"); break; } } @@ -169,7 +169,7 @@ private bool UninstallPkgHelper() if (!ShouldProcess(string.Format("Uninstall resource '{0}' from the machine.", pkgName))) { - this.WriteDebug("ShouldProcess is set to false."); + WriteVerbose("ShouldProcess is set to false."); continue; } diff --git a/src/code/UnregisterPSResourceRepository.cs b/src/code/UnregisterPSResourceRepository.cs index 2da1a284a..6257b77f0 100644 --- a/src/code/UnregisterPSResourceRepository.cs +++ b/src/code/UnregisterPSResourceRepository.cs @@ -39,7 +39,7 @@ protected override void BeginProcessing() { try { - WriteDebug("Calling API to check repository store exists in non-corrupted state"); + WriteVerbose("Calling API to check repository store exists in non-corrupted state"); RepositorySettings.CheckRepositoryStore(); } catch (PSInvalidOperationException e) @@ -54,7 +54,7 @@ protected override void BeginProcessing() protected override void ProcessRecord() { string nameArrayAsString = string.Join(", ", Name); - WriteDebug(String.Format("removing repository {0}. Calling Remove() API now", nameArrayAsString)); + WriteVerbose(String.Format("removing repository {0}. Calling Remove() API now", nameArrayAsString)); if (!ShouldProcess(nameArrayAsString, "Unregister repositories from repository store")) { return; diff --git a/src/code/Utils.cs b/src/code/Utils.cs index 8b2fa3a29..b4881b3c8 100644 --- a/src/code/Utils.cs +++ b/src/code/Utils.cs @@ -300,7 +300,7 @@ public static List GetAllResourcePaths(PSCmdlet psCmdlet) // add all module directories or script files foreach (string path in resourcePaths) { - psCmdlet.WriteDebug(string.Format("Retrieving directories in the path '{0}'", path)); + psCmdlet.WriteVerbose(string.Format("Retrieving directories in the path '{0}'", path)); if (path.EndsWith("Scripts")) { @@ -331,7 +331,7 @@ public static List GetAllResourcePaths(PSCmdlet psCmdlet) // ./PowerShell/Modules/TestModule // need to use .ToList() to cast the IEnumerable to type List pathsToSearch = pathsToSearch.Distinct(StringComparer.InvariantCultureIgnoreCase).ToList(); - pathsToSearch.ForEach(dir => psCmdlet.WriteDebug(string.Format("All paths to search: '{0}'", dir))); + pathsToSearch.ForEach(dir => psCmdlet.WriteVerbose(string.Format("All paths to search: '{0}'", dir))); return pathsToSearch; } @@ -358,7 +358,7 @@ public static List GetAllInstallationPaths(PSCmdlet psCmdlet, ScopeType } installationPaths = installationPaths.Distinct(StringComparer.InvariantCultureIgnoreCase).ToList(); - installationPaths.ForEach(dir => psCmdlet.WriteDebug(string.Format("All paths to search: '{0}'", dir))); + installationPaths.ForEach(dir => psCmdlet.WriteVerbose(string.Format("All paths to search: '{0}'", dir))); return installationPaths; }