Commit graph

152 commits

Author SHA1 Message Date
Ilya 4e58ee6426
Cleanup '#if !CORECLR' code (#8337)
* NewWinEventCommand.cs
* CredSSP.cs
* WsManHelper.cs
* debugger.cs
* InternalHost.cs
* InitialSessionState.cs
* BaseTransportManager.cs
* Types_Ps1Xml.cs
* FileSystemProvider.cs
* Restore XmlResolver = null
2018-11-30 08:11:20 +05:00
Ilya 9953ccb765
Cleanup '#if CORECLR' from some files (#8332)
* CommonUtilities
* CredSSP
* WsManHelper.cs
* InternalHost
2018-11-26 10:08:10 +05:00
Ilya 0a4f33a872
Replace StringComparision.CurrentCulture with StringComparision.Ordinal (#8068) 2018-10-21 16:11:08 +05:00
Vijayakrishna Pondala 97bcd8c88e Remove unused commented out code (#7935) 2018-10-04 15:17:38 +05:00
Steve Lee b99fde0389 Fix perf issue in provider by using Refresh() to update the status rather than instantiating ServiceController which has a significant perf degradation from .NET Framework (#7680) 2018-09-04 10:00:16 -07:00
Ilya 5d03e1653a
Remove empty xml comment lines (#7401) 2018-08-01 10:39:13 +05:00
Ilya 4fc784e840 Bulk update code base to put 'null' on the right-hand-side of a comparison expression (#6949) 2018-06-25 14:37:09 -07:00
Ilya e177fcaef6 CodeFactor code style cleanup: replace literal empty strings with 'string.Empty' (#6950) 2018-06-12 12:30:10 -07:00
Steve Lee 5dc7a6cb07 Add Windows Compatibility Pack 2.0.0 to PS Core and adopt the official .NET Core 2.1 (#6958)
To support PowerShell modules built with .NET Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PS Core. This also adds many new .NET APIs be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).
Also update the build to adopt the official .NET Core 2.1.
2018-06-03 22:06:26 -07:00
Travis Plunk 472b5f7bd1
Enable full symbols for windows (#6853)
The main purpose of this was to enable full symbols for windows release build.
Also makes explicit where we are optimizing and where we are not optimizing due to https://github.com/dotnet/corefx/issues/29700
2018-05-14 15:01:44 -07:00
Ilya 84344cbb32 Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 (#6718)
* Build Update
- Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props`
- Update dotnet SDK to 2.1.300-rc1-008662
- Update `TypeGen` target in `Build.psm1` to work with 2.1
- Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system.
- Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1
- Update search for `crossgen` executable to find the matching version

* Test Update
- Update test tools `WebListener` to latest `asp.net core`
- Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX
2018-05-02 16:58:39 -07:00
Kevin Marquette 548850d249 Add 'Path' alias to '-FilePath' parameters and others for several commands (#5817) 2018-02-27 13:05:58 -08:00
Steve Lee c1c5344a88 Update copyright and license headers (#6134)
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.

Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.

Separate PR coming to update contribution document for new source files: #6140

Manually reviewed each change.

Fix #6073
2018-02-13 09:23:53 -08:00
Travis Plunk 1c5c7f5c3a
add comments about where most of the packages are from (#6016) 2018-01-31 12:16:48 -08:00
Travis Plunk a603cf3867
Update csproj files to the latest version of the package references (#5961)
* Add function which tells you packages which probably need to be updated
2018-01-22 12:06:50 -08:00
Himura Kazuto 6530b779d9 Multiple improvements by CodeRush Static Analysis (#5132) 2017-11-10 09:03:34 -08:00
Steve Lee 4bc52d2358 Use consistent '(c)' for copyright symbol (#5210)
- Remove the year about copyright
- Fix casing of `All rights reserved`
- Replace Unicode characters representing single quote with a single quote
2017-10-26 14:12:19 -07:00
Jason Shirk de70969f4e Add VS 2017 solution file for powershell-win-core (#4748) 2017-09-18 17:13:29 -07:00
Steve Lee 23420643e3 Added WSMan Config provider tests (#4756)
* [Feature]
fixed issues in WSMan Config Provider
added tests for get-item, get-childitem, set-item, new-item remove-item, clear-item, dynamic parameters
merged CoreClr and FullClr code

* [feature]
address PR feedback

* [feature]
revert to using microsoft.powershell plugin as base for test
keeps it simple rather than relying on additional scripts or cmdlets since these tests don't require remoting

* [feature]
address Aditya's feedback

* [feature]
address some cosmetic feedback

* [feature]
based on discussion with Jim, we should skip resx checks on non-Windows
2017-09-18 15:44:09 -07:00
Ilya 3c597367ba Replace 'Windows PowerShell' with 'PowerShell' in resx files (#4758)
Replace 'Windows PowerShell' with 'PowerShell' in '.resx' files where appropriate.
2017-09-07 12:33:56 -07:00
Steve Lee fb286e6cf8 Removed double spaces from .cs and .ps1 files (#4743) 2017-09-04 19:45:51 -07:00
Ilya cdbbb7a4bb Minor formatting commits for Build.psm1 and csproj files (#4630) 2017-08-21 15:23:52 -07:00
Dongbo Wang 7762d7bf49 clean up map.json related files and scripts (#4532)
* clean up map.json related files and scripts

* Update .spelling
2017-08-10 13:32:19 -07:00
Steve Lee eea3885242 Enable WSManCredSSP cmdlets (#4336)
* [Feature]
Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used

* [Feature]
merged tests to one file, use runas to have relevant tests run as non-elevated

* [Feature]
Get-CredSSP returns text so only run that test if current culture is en-US

* [Feature] Update test to fix code exclusion

* [Feature] Fix Skipping on test cases that already had a Skip value
2017-08-10 13:31:54 -07:00
Ilya a9535030ac Cleanup '#if CORE' in Set-QuickConfig.cs (#4410) 2017-07-31 13:04:23 -07:00
Ilya f3b18251cf Cleanup '#if CORE' in CurrentConfigurations.cs (#4409) 2017-07-31 12:58:44 -07:00
Ilya a8e3d8968f Refactor MSBuild project files by adding the common property file 'PowerShell.Common.props' (#4106)
`AssemblyVersion` and `FileVersion` are now inferred from the `Version` property, which is inferred by `VersionPrefix`. So now both `AssemblyVersion` and `FileVersion` are 6.0.0.0 for each of PowerShell assemblies, and the `ProductVersion` and `InformationalVersion` are 6.0.0.
2017-06-29 10:25:49 -07:00
Mike Richmond a291834f39 Revert "Set assembly versions by MSBuild" (#4091) 2017-06-23 10:17:25 -07:00
Ilya c549925f67 Set assembly versions by MSBuild (#3917)
* Update assemblies versions by MSBuild and create a new PowerShellAssembly.props file to consolidate properties.

* Move import on first place

* Move to "6.0.0-beta.3"
2017-06-22 18:21:36 -07:00
Ilya aa97fe7cd1 Resx - remove trailing white spaces and extra Newline at EOF (#4047) 2017-06-22 13:45:11 -07:00
Ilya f04d2fd2bc Convert tab indentations to spaces in *.resx files (#3576)
* Convert tab indentations to spaces in *.resx files

* Add Newline at EOF

* Remove extra char
2017-06-06 18:18:59 -07:00
Dongbo Wang 1b16f77e21 Update powershell to use .NET Core 2.0.0-preview1-002106-00 (#3699)
Use 2.0 CLI/SDK of version `2.0.0-preview1-005952` to keep in sync with the .NET Core 2.0 //Build dogfood instructions. The version of `Microsoft.NetCore.App` in use is `2.0.0-preview1-002106-00`.
2017-05-04 17:09:03 -07:00
Dongbo Wang 7a55bf98b2 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 11:52:38 -07:00
Dongbo Wang 54fa658e31 Migrate from project.json to MSBuild (#3398)
- FullCLR build is disabled in this change.
- FullCLR build related functionalities in `build.psm1` and `AppVeyor.psm1` are disabled. They are not cleaned up from `build.psm1` and `AppVeyor.psm1` yet. We need to adopt .NET Core 2.0 to verify the portable module concept, and if that works well, we will remove the Windows PowerShell source code and clean up our scripts.
- `dnxcore50` and `portable-net5+win8` target framework monikers are removed.
- Dependency on `Microsoft.NETCore.Portable.Compatibility` is removed. It's not necessary, but it may come back when we work on supporting the `portable module`. Its necessity can be reviewed at that time.
- I didn't spend the time to try building powershell in Visual Studio 2017. We should have a separate issue for that. It's tracked by #3400

The `TypeCatalogParser` project is replaced by a MSBuild target to gather the dependency information.
Due to .NET Core SDK issue [#1021](https://github.com/dotnet/sdk/issues/1021), our meta-package project `Microsoft.PowerShell.SDK` starts to generate an empty assembly during the build and that results in an empty assembly `Microsoft.PowerShell.SDK.dll` appear in `publish` folder and in `.deps.json` file. We cannot simply remove the assembly because it's now part of the TPA, and removing it will cause powershell to crash at startup. We have to live with this empty assembly until that .NET Core SDK issue is fixed.  It's tracked by #3401.
2017-03-23 13:04:52 -07:00
Christopher Ubben b2259f8f70 Update all W3 links in the resource files to use HTTPS instead of HTTP (#3331) 2017-03-17 11:04:00 -07:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Aditya Patwardhan b18adb85d4 Add OpenCover PS Module to collect code coverage (#2585)
* Add OpenCover PS Module to collect code coverage

OpenCover PS Module helps is collecting Code Coverage using the OpenCover
toolset. The module helps in comparing two code coverage runs as well.

* Change OpenCover.psd1 to ASCII

* Fix an error in path for OpenCover

Fixed an error on path for OpenCover. Also used ZipFile class instead of
cmdlet as it might not be available on CI system.

* Convert module to be Powershell v4 compliant

Changed implementation from classes to PSObjects and implemented
Expand-ZipArchive.

* Added CodeCoverage as a configuration to project.json files

Added CodeCoverage as the new configuration for all the project.json
files. When Start-PSBuild is executed with configuration as CodeCoverage,
we change the degubType to 'full' as required by OpenCover toolset.

Also made changes to appveyor.psm1 to build a CodeCoverage package on
daily builds and publish it as a zip.

* Addressed code review comments

Changed from Add-Member to use pscustomobject type accelator. Removed
[gc]::collect.

* Added explicit garbage collection

* Addressed code review comments

- Make sure that the build Start-PSPackage gets is not a code coverage
  build
- Add debugType = full for FullCLR
- Remove configurations from PackageManagement files as it is not needed.
- Build CodeCoverage build first in AppVeyor.

* Resolve merge conflict

* Fix indentation

* Fix newline at end of file

* Added command discovery for locating OpenCover.console.exe
2016-11-11 11:12:07 -08:00
Dongbo Wang f96dcbb016 Update project version to 6.0.0 to match our release version 2016-11-04 16:33:35 -07:00
Dongbo Wang 2e402cfef1 Update powershell to depend on latest dotnet core packages (preview1-24530-04 from 9/30/2016) 2016-10-14 10:02:44 -07:00
Josh Soref 6d19f046ac spelling: public identifiers in src/Microsoft.WSMan.Management 2016-09-16 03:07:16 +00:00
George Chakhidze e8190a569b Use prefixed QNames in XPath expressions used by all implementations of ICmdletProviderSupportsHelp interface
Also includes these bugfixes:
  - WSManConfigProvider.GetHelpMaml: Tried to load XML from
    MemoryStream that was created from file name string. Use XmlReader
    instead.
  - WSManConfigProvider.GetHelpMaml: Use Path.Combine instead of
    platform-specific directory separator character.
  - WSManConfigProvider.GetHelpMaml: CmdletHelpPath MAML XML element
    attribute `ID` name casing seems inconsistent with other help.xml
    files. XPath 1.0 does not support case-insensitive expressions,
    use both `id` and `ID` in query.
  - Add Pester test to verify that Get-Help shows provider-specific help.

Fixes #2088
2016-09-13 09:40:14 +04:00
Josh Soref 3cdb922cf0 spelling: locals in src/Microsoft.WSMan.Management 2016-08-30 03:53:12 +00:00
Dongbo Wang 58a2ba730d Merge pull request #2046 from xiaoyinl/use-https-links
Use HTTPS links for go.microsoft.com
2016-09-01 17:23:09 -07:00
Josh Soref 1f91366e7a spelling: comments in src/Microsoft.WSMan.Management 2016-08-28 06:07:41 +00:00
xiaoyinl f538eeb416 Use HTTPS links for go.microsoft.com
I replace all occurrences of http://go.microsoft.com with https://go.microsoft.com in text files.
2016-08-23 21:21:31 -04:00
Adam Driscoll c829d9e915 Adding debugType portable to project.json. (#1959)
* Adding debugType portable to project.json.

* Move debugType.

* Update project.json

* Update project.json

* Update project.json

* Update project.json

* Update project.json

* Update project.json

* Update project.json

* Update project.json

* Moving debugType into correct places. Removing from non-core builds.

* Added missed files.

* Fixing project.json debugType placement.
2016-08-23 10:38:25 -07:00
Sergei Vorobev a655c9a27b Add AssemlbyInfo.cs files
- Microsoft.WSMan.Runtime
- Microsoft.WSMan.Management
- Microsoft.Management.Infrastructure.CimCmdlets
2016-07-14 15:40:56 -07:00
Sergei Vorobev eb0d6905ab Fix ResourceManager instantiation in WsManHelper.cs 2016-07-14 13:46:29 -07:00
PowerShell Team 160ab847d5 Convert txt resources into resx for Microsoft.WSMan.Management 2016-07-14 13:46:29 -07:00
PowerShell Team bc6990f46b Copy cs files from [SD:717473]
commit 96877403a6a2eb9dcbee0f71bbc6dfb6e61dd9a3

- Microsoft.WSMan.Runtime
- Microsoft.WSMan.Management
- Microsoft.Management.Infrastructure.CimCmdlets
2016-07-14 13:46:29 -07:00
Sergei Vorobev 132d98e3c7 Add project.json files
- Microsoft.WSMan.Runtime
- Microsoft.WSMan.Management
- Microsoft.Management.Infrastructure.CimCmdlets
2016-07-14 13:46:29 -07:00
Sergei Vorobev 5802a02786 Add map.json files
- Microsoft.WSMan.Runtime
- Microsoft.WSMan.Management
- Microsoft.Management.Infrastructure.CimCmdlets
2016-07-14 13:46:29 -07:00