mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Remove logging for installation from OneGet on Linux
This commit is contained in:
@@ -19,6 +19,14 @@
|
||||
throw new ArgumentNullException("packageSource");
|
||||
}
|
||||
|
||||
#if LINUX
|
||||
// we cannot call new uri on file path on linux because it will error out
|
||||
if (System.IO.Directory.Exists(packageSource))
|
||||
{
|
||||
return new LocalPackageRepository(packageSource, request);
|
||||
}
|
||||
#endif
|
||||
|
||||
Uri uri = new Uri(packageSource);
|
||||
|
||||
if (uri.IsFile)
|
||||
|
||||
@@ -506,6 +506,7 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
Save = 4103
|
||||
}
|
||||
|
||||
#if !LINUX
|
||||
protected void LogEvent(EventTask task, EventId id, string context, string name, string version, string providerName, string source, string status, string destinationPath)
|
||||
{
|
||||
var iis = InitialSessionState.CreateDefault2();
|
||||
@@ -536,6 +537,7 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -685,6 +685,7 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
}
|
||||
|
||||
WriteObject(AddPropertyToSoftwareIdentity(installedPkg));
|
||||
#if !LINUX
|
||||
LogEvent(EventTask.Install, EventId.Install,
|
||||
Resources.Messages.PackageInstalled,
|
||||
installedPkg.Name,
|
||||
@@ -694,6 +695,7 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
installedPkg.Status ?? string.Empty,
|
||||
installedPkg.InstallationPath ?? string.Empty);
|
||||
TraceMessage(Constants.InstallPackageTrace, installedPkg);
|
||||
#endif
|
||||
triedInstallCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,8 +254,10 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
}
|
||||
|
||||
WriteObject(AddPropertyToSoftwareIdentity(downloadedPkg));
|
||||
#if !LINUX
|
||||
LogEvent(EventTask.Download, EventId.Save, Resources.Messages.PackageSaved, downloadedPkg.Name, downloadedPkg.Version, downloadedPkg.ProviderName, downloadedPkg.Source ?? string.Empty, downloadedPkg.Status ?? string.Empty, downloadedPkg.InstallationPath ?? string.Empty);
|
||||
TraceMessage(Constants.SavePackageTrace, downloadedPkg);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -168,8 +168,10 @@ namespace Microsoft.PowerShell.PackageManagement.Cmdlets {
|
||||
return false;
|
||||
}
|
||||
WriteObject(installedPkg);
|
||||
#if !LINUX
|
||||
LogEvent(EventTask.Uninstall, EventId.Uninstall, Resources.Messages.PackageUnInstalled, installedPkg.Name, installedPkg.Version, installedPkg.ProviderName, installedPkg.Source ?? string.Empty, installedPkg.Status ?? string.Empty, installedPkg.InstallationPath ?? string.Empty);
|
||||
TraceMessage(Constants.UnInstallPackageTrace, installedPkg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user