Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions GVFS/GVFS.Platform.Windows/ProjFSFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,16 @@ private static bool TryEnableProjFSOptionalFeature(ITracer tracer, PhysicalFileS

private static ProcessResult GetProjFSOptionalFeatureStatus()
{
return CallPowershellCommand(
"$var=(Get-WindowsOptionalFeature -Online -FeatureName " + OptionalFeatureName + "); if($var -eq $null){exit " +
(int)ProjFSInboxStatus.NotInbox + "}else{if($var.State -eq 'Enabled'){exit " + (int)ProjFSInboxStatus.Enabled + "}else{exit " + (int)ProjFSInboxStatus.Disabled + "}}");
try
{
return CallPowershellCommand(
"$var=(Get-WindowsOptionalFeature -Online -FeatureName " + OptionalFeatureName + "); if($var -eq $null){exit " +
(int)ProjFSInboxStatus.NotInbox + "}else{if($var.State -eq 'Enabled'){exit " + (int)ProjFSInboxStatus.Enabled + "}else{exit " + (int)ProjFSInboxStatus.Disabled + "}}");
}
catch (Exception)
{
return new ProcessResult(string.Empty, "Failed. Possible that powershell does not exist on system", 1);
}
Comment thread
derrickstolee marked this conversation as resolved.
}

private static EventMetadata CreateEventMetadata(Exception e = null)
Expand Down