PowerShell/src/System.Management.Automation/System.Management.Automation.csproj

77 lines
4.1 KiB
XML
Raw Normal View History

<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="..\..\PowerShell.Common.props" />
2017-03-23 21:04:52 +01:00
<PropertyGroup>
<Description>PowerShell's System.Management.Automation project</Description>
<NoWarn>$(NoWarn);CS1570;CS1734;CA1416</NoWarn>
2017-03-23 21:04:52 +01:00
<AssemblyName>System.Management.Automation</AssemblyName>
</PropertyGroup>
<ItemGroup Condition=" '$(IsWindows)' == 'true' ">
2017-03-23 21:04:52 +01:00
<ProjectReference Include="..\Microsoft.PowerShell.CoreCLR.Eventing\Microsoft.PowerShell.CoreCLR.Eventing.csproj" />
</ItemGroup>
<ItemGroup>
<!-- the following package(s) are from https://github.com/JamesNK/Newtonsoft.Json -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- the Application Insights package -->
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.19.0" />
<!-- the following package(s) are from https://github.com/dotnet/corefx -->
<PackageReference Include="Microsoft.Win32.Registry.AccessControl" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
<PackageReference Include="System.DirectoryServices" Version="6.0.0" />
<!--PackageReference Include="System.IO.FileSystem.AccessControl" Version="6.0.0-preview.5.21301.5" /-->
<PackageReference Include="System.Management" Version="6.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Security.AccessControl" Version="6.0.0" />
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.0" />
<PackageReference Include="System.Security.Permissions" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
<!-- the following package(s) are from the powershell org -->
<PackageReference Include="Microsoft.Management.Infrastructure" Version="2.0.0" />
<PackageReference Include="Microsoft.PowerShell.Native" Version="7.2.0" />
2017-03-23 21:04:52 +01:00
</ItemGroup>
Move powershell to .NET Core 2.0 (#3556) This change moves powershell to .NET Core 2.0. Major changes are: 1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`. 2. Refactor code to remove most CLR stub types and extension types. 3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed. 4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded). 5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286](https://github.com/dotnet/cli/issues/6286) is tracking this. 6. Replace the use of some APIs with the ones that take `SecureString`. 7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12. 8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797](https://github.com/dotnet/corefx/issues/17797). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 20:52:38 +02:00
<PropertyGroup>
2017-03-23 21:04:52 +01:00
<DefineConstants>$(DefineConstants);CORECLR</DefineConstants>
</PropertyGroup>
Move powershell to .NET Core 2.0 (#3556) This change moves powershell to .NET Core 2.0. Major changes are: 1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`. 2. Refactor code to remove most CLR stub types and extension types. 3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed. 4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded). 5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286](https://github.com/dotnet/cli/issues/6286) is tracking this. 6. Replace the use of some APIs with the ones that take `SecureString`. 7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12. 8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797](https://github.com/dotnet/corefx/issues/17797). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 20:52:38 +02:00
<ItemGroup>
2017-03-23 21:04:52 +01:00
<Compile Remove="cimSupport\cmdletization\xml\cmdlets-over-objects.objectModel.autogen.cs" />
<Compile Remove="cimSupport\cmdletization\xml\cmdlets-over-objects.xmlSerializer.autogen.cs" />
<Compile Remove="engine\TransactedString.cs" />
<Compile Remove="engine\TransactionManager.cs" />
<Compile Remove="engine\hostifaces\NativeCultureResolver.cs" />
<Compile Remove="engine\hostifaces\RunspaceInvoke.cs" />
<Compile Remove="engine\remoting\commands\ResumeJob.cs" />
<Compile Remove="engine\remoting\commands\SuspendJob.cs" />
2017-03-23 21:04:52 +01:00
<Compile Remove="logging\eventlog\EventLogLogProvider.cs" />
<Compile Remove="namespaces\SafeTransactionHandle.cs" />
Move powershell to .NET Core 2.0 (#3556) This change moves powershell to .NET Core 2.0. Major changes are: 1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`. 2. Refactor code to remove most CLR stub types and extension types. 3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed. 4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded). 5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286](https://github.com/dotnet/cli/issues/6286) is tracking this. 6. Replace the use of some APIs with the ones that take `SecureString`. 7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12. 8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797](https://github.com/dotnet/corefx/issues/17797). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 20:52:38 +02:00
<Compile Remove="namespaces\SafeRegistryHandle.cs" />
2017-03-23 21:04:52 +01:00
<Compile Remove="namespaces\TransactedRegistry.cs" />
<Compile Remove="namespaces\TransactedRegistryKey.cs" />
<Compile Remove="namespaces\TransactedRegistrySecurity.cs" />
<Compile Remove="utils\BackgroundDispatcher.cs" />
<Compile Remove="utils\perfCounters\CounterSetInstanceBase.cs" />
<Compile Remove="utils\perfCounters\CounterSetRegistrarBase.cs" />
<Compile Remove="utils\perfCounters\PSPerfCountersMgr.cs" />
<Compile Remove="gen\CoreMshSnapinResources.cs" />
<Compile Remove="gen\ErrorPackageRemoting.cs" />
Redirect ETW logging to Syslog on Linux (#5144) This PR is divided into the following areas: 1. Add/Rename the PowerShell/Windows ETW manifest to the repo and change both the provider id (guid) and name. See #4939. The manifest is at tools/resxgen/PowerShell-Core-Instrumentation.man 2. Generate a resx file containing the string resources needed for logging ETW events to syslog. This is accomplished by tools\resxgen\resxgen.psm1 and resxgen.ps1. The tool generates two files A resx file containing string resources for each message string from the manifest. This is generated in the System.Management.Automation\gen directory. A C# class (EventResource) that provides the mapping between the integer event id and the associated string resource name. The file is generated in the System.Management.Automation\CoreCLR directory with a compile-time condition of UNIX NOTE: The EventResource.cs class generated by resgen is explicitly ignored in the csproj file; it is not used. 3. SMA\utils\tracing\PSSysLogProvider.cs Implements the abstract LogProvider class and is the syslog equivalent of PSEtwLogProvider. The class contains a number of logical methods for logging lifecycle, health, and normal events. 4. SMA\utils\tracing\SysLogProvider.cs This is the Syslog equivalent of ETW's log provider class and implements a Log method versus ETW's EventWrite. It is also responsible for resolving event ids to resource names and performing the Syslog call. There is a large comment block in the class XML doc that describes the types of log output it produces. 5. SMA\utils\tracing\PSEtwLog.cs PowerShell's current implementation is tightly coupled to this class; with code calling it directly for all events. To simplify integration of syslog, I updated the class to create an instance of PSSysLogProvider on Linux and removed the Linux-specific stub file. 6. SMA\engine\PropertyAccessor.cs This class provides a wrapper around PowerShellProperties.json and has been extended to have Unix-specific assessors for configuring logging. Note that the file is expected to be in the $PSHOME directory to ensure SxS. Currently, there are four configuration properties: - LogIdentity - the string identifier for the source application. This defaults to 'powershell' and can be configured to enable distinguishing between side-by-side installations. - LogLevel - configures the tracing level (log level). Informational is the defauilt. - LogChannels - used to enable operational and analytic logging. Operational is the default. - LogKeywords - used to configure enabling tracing by keyword. All keywords other than `UseAlwaysAnalytic` are enabled by default. NOTE: This will likely change. PowerShell sometimes confuses the analytic channel with this keyword and sends logging to the wrong channel. Once this is cleared up, `UseAlwaysAnalytic` and `UseAlwaysOperational` keywords will likely be removed. Additional Notes: 1. The current implementation writes directly to syslog and writing to a separate log file is still pending. 2. The generated class and resx are not part of the build; instead, it is expected that Resxgen should be run when events are added to the manifest. To fully automate the process, resxgen will need to be updated to generate the other dependent enums such as 'PSChannel', 'PSEventId', 'PSTask', 'PSOpcode', etc. You will see parsing logic in resxgen.psm1 to prepare for that but it is not enabled at this point. 4. Documentation is pending that documents the format of the syslog output as well as associated configuration. 5. As mentioned at the start, tests are pending
2017-11-06 17:32:29 +01:00
<Compile Remove="gen\EventResource.cs" />
2017-03-23 21:04:52 +01:00
<EmbeddedResource Remove="resources\CoreMshSnapinResources.resx" />
<EmbeddedResource Remove="resources\ErrorPackageRemoting.resx" />
</ItemGroup>
<ItemGroup Condition=" '$(IsWindows)' != 'true' ">
<Compile Remove="engine\ExtraAdapter.cs" />
<Compile Remove="engine\ManagementObjectAdapter.cs" />
<Compile Remove="engine\ComInterop\**\*.cs" />
<Compile Remove="engine\remoting\commands\ConnectPSSession.cs" />
<Compile Remove="engine\remoting\commands\CustomShellCommands.cs" />
<Compile Remove="engine\remoting\commands\DisconnectPSSession.cs" />
<Compile Remove="engine\remoting\commands\ReceivePSSession.cs" />
<Compile Remove="engine\remoting\commands\TestPSSessionConfigurationFile.cs" />
</ItemGroup>
2017-03-23 21:04:52 +01:00
</Project>