Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !UNIX
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
Expand Down Expand Up @@ -161,4 +162,5 @@ private bool IsValidFileForUnblocking(string resolvedpath)
return isValidUnblockableFile;
}
}
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,9 @@ private IEnumerable<string> CreateCimModuleFiles(
fullPath,
file.RawFileData);

#if !UNIX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if we need this #if here. This is part of CIM modules which I believe is not supported on Linux platforms and so this code should never run on non-Windows platforms.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe CDXML cmdlets can work on Linux via OMI

AlternateDataStreamUtilities.SetZoneOfOrigin(fullPath, SecurityZone.Intranet);
#endif
}

return relativePathsToCreatedFiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,22 +841,26 @@ private void CreateStreams(string filePath, string streamName, FileMode fileMode

try
{
#if !UNIX
if (!String.IsNullOrEmpty(streamName))
{
_stream = AlternateDataStreamUtilities.CreateFileStream(filePath, streamName, fileMode, fileAccess, fileShare);
}
else
#endif
{
_stream = new FileStream(filePath, fileMode, fileAccess, fileShare);
}
}
catch (IOException)
{
#if !UNIX
if (!String.IsNullOrEmpty(streamName))
{
_stream = AlternateDataStreamUtilities.CreateFileStream(filePath, streamName, fileMode, requestedAccess, fileShare);
}
else
#endif
{
_stream = new FileStream(filePath, fileMode, requestedAccess, fileShare);
}
Expand Down
Loading