Commit graph

5811 commits

Author SHA1 Message Date
Steve Lee 0d893a59c7 Remove sc alias which conflicts with sc.exe (#5827) 2018-01-08 17:20:00 -08:00
Aditya Patwardhan d6288a3e2f Updated Help Uri to point to latest help content for Microsoft.PowerShell.Core module (#5820) 2018-01-08 16:37:59 -08:00
Christoph Bergmeister f8a5fc1f19 packaging: x86 package gets installed as an x64 component and has the same UpgradeCode as the x64 installer leading to an uninstallation of an x64 installation (and vice versa) (#5812)
Fix bug #5597: x86/x64 installer are uninstalling each other when installing either of them:

-Make x86 installer to be installed as an x86 component (-arch argument to candle.exe, which sets the `sys.BUILDARCH` variable)
-Make the UpgradeCode unique per platform
-Replace `var.ProductTargetArchitecture` variable with sys.BUILDARCH use to have only 1 variable for the architecture
-Additionally, the architecture was appended to the package name to be able to distinguish the installations.
2018-01-08 12:32:38 -08:00
Andrew 45a2a19abd Update the installation doc for Raspberry-Pi about supported devices (#5773) 2018-01-08 12:21:32 -08:00
Mark Kraus 1b3d1eed5a Fix a typo and a Markdonw linting error in the Pull Request Template (#5807) 2018-01-08 12:14:48 -08:00
Dongbo Wang d261e1f166
Move group policy settings and enable policy controlled logging in PowerShell Core (#5791)
Make PowerShell Core reads group policy settings from different registry keys (Windows only) and the configuration files (both Windows and Unix).
- On Windows, move to different GPO registry keys.
- On both Windows and Unix, read GPO related settings from the configuration file `powershell.config.json`.
- On Windows, the policy settings in registry take precedence over the configuration file.
- Enable policy controlled logging and transcription on Unix.
2018-01-08 12:03:23 -08:00
Dongbo Wang 01ecf4b3d3 [Feature] Address Steve's new comments 2018-01-08 09:54:28 -08:00
Dongbo Wang 6ee608ff58 [Feature] Consider a policy is undefined if none of its properties are set 2018-01-07 15:53:07 -08:00
Chris e351a7e5c2 Move checkbox to the top to allow toggling it using the space bar (the Enter key already defaults to the Finish) button. (#5792)
Move definition of Launch PowerShell checkbox to the top to allow toggling it using the spacebar (the Enter key already defaults to the Finish button).
Reuse product name variable.
2018-01-06 11:53:45 +04:00
Dan Travison da5d897823 SAL annotation updates & fix warnings (#5617)
Various SAL annotations were either incorrect or not backed up by code. This PR address these issues.

NOTE: By default, Start-BuildNativeWindowsBinaries does not enable code analysis and issues detected by SAL annotations are not reported. To identify these issues, run Start-BuildNativeWindowsBinaries to generate the solution and vcxproj files. Launch a Visual Studio developer prompt, cd to src\powershell-native and run msbuild manually.

> msbuild PowerShellNative.sln /p:RunCodeAnalysis=true /p:Configuration=RelWithDebInfo /p:Platform=x64

The following changes address all code analysis warnings:

- GetRegistryInfo in NativeMsh had incorrect out annotations, remove __opt
- Fix handling of various out parameters - check for non-null and initialize
- Update and Align SAL annotations for GetFormattedErrorMessage overloads
- Allow PluginException to accept NULL message.
2018-01-05 16:53:27 -08:00
Chris 0f60625879 docs: update submodule documentation for pester removal (#5786)
Since Pester is not a submodule anymore, replace submodule example in git submodule docs/FAQ.md with the only leftover submodule src/libpsl-native/test/googletest
2018-01-05 16:47:07 -08:00
Dongbo Wang 3b941735d2 [Feature] Change two methods to use 'private' modifier. 2018-01-05 16:34:13 -08:00
Dongbo Wang 3b5badca04 Rename 'PowerShellProperties.json' to 'powershell.config.json' 2018-01-05 16:06:36 -08:00
Dongbo Wang b4b864f5da Re-enable group policy settings from registry
On windows, group policy settings from registry takes precedence over the configuration file.
If a policy is not defined in GP, then we query from configuration file.
2018-01-05 14:33:37 -08:00
Chris 22f47295f4 docs: update submodule documentation for pester removal (#5786)
Since Pester is not a submodule anymore, replace submodule example in git submodule docs/FAQ.md with the only leftover submodule src/libpsl-native/test/googletest
2018-01-05 12:29:55 -08:00
Ilya 6825182a6a
Add ForEach and Where methods to [PSCustomobject] (#5756) 2018-01-05 22:54:31 +04:00
Chris ceb8f50e43 Add option to add explorer context menu in Windows installer (#5774)
A new dialogue is added in the Windows installer to offer the option of adding explorer.exe context menus to open PowerShell in the current location as a normal shell or as administrator. The context menu entries are achiveven via registry entries and is available when right-clicking on:
- the background of explorer
- a folder in explorer
- a drive in explorer
- on the Desktop
2018-01-05 21:53:19 +04:00
Ilya aaa567cf8c
Show usage (short) help if command line parameter is wrong (#5780)
Show usage (short) help if command line parameter is wrong
Show extended (full) help message with pwsh -h
Split Help message on Usage and Extended
2018-01-05 15:36:45 +04:00
Dongbo Wang 167bbad1d1 Address one of Dan's comments 2018-01-04 21:00:13 -08:00
Dan Travison 63b80945a1 remoting: Handle DLLImport failure of libpsrpclient (#5622)
Issue #4029 exposed two problems when failing to load libpsrpclient.

WSManAPIDataCommon.ctor was not identifying the binary that failed DLLImport; hindering diagnosability
PrioritySendDataCollection.Clear() would throw a NullReferenceException when called from the finalizer after an error path.
This change addresses both of the above:

Guard against null arrays in PrioritySendDataCollection.Clear() - called from finalizer in error paths.

Diagnosability: Log the DllNotFoundException in WSManAPIDataCommon ctor and also include it as the internal exception when throwing PSRemotingTransportException.
2018-01-04 17:17:34 -08:00
Dan Travison d2db6b4098 Build: Update Restore-PSPester to include the fix for nested describe errors (#5771)
Update Restore-PSPester to include PR PowerShell/psl-pester#12 that fixes PowerShell/psl-pester#11 - unhandled exceptions in before/after bypasses Pester's enddescribe logic.  
Update to the latest, while we are at it.
2018-01-04 17:17:34 -08:00
Dongbo Wang a6c62bfc58 [Feature] Minor changes to make ScriptBlock logging work with SysLog 2018-01-04 13:40:51 -08:00
Dongbo Wang 117e83a025 Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -08:00
Dongbo Wang 41c66dbc26 Refactor GroupPolicy setting related code to use the configuration file 2018-01-04 13:40:50 -08:00
Dongbo Wang 6ab1ad7ea8 Rename file PropertyAccessor.cs to PSConfiguration.cs 2018-01-04 13:40:50 -08:00
Dongbo Wang 263ec24ae3 Rename 'PropertyScope' to 'ConfigScope' 2018-01-04 13:40:50 -08:00
Dongbo Wang 3dd86f5148 Refactor 'PropertyAccessor.cs'
- Remove the unneeded base type;
- Rename 'ConfigPropertyAccessor' to 'PowerShellConfig';
- Move 'PowerShellConfig' to the namespace 'System.Management.Automation.Configuration'
2018-01-04 13:40:50 -08:00
Dongbo Wang 39af334f9f Enable logging on Linux through MshLog 2018-01-04 13:40:34 -08:00
Dan Travison 5488131931 remoting: Handle DLLImport failure of libpsrpclient (#5622)
Issue #4029 exposed two problems when failing to load libpsrpclient.

WSManAPIDataCommon.ctor was not identifying the binary that failed DLLImport; hindering diagnosability
PrioritySendDataCollection.Clear() would throw a NullReferenceException when called from the finalizer after an error path.
This change addresses both of the above:

Guard against null arrays in PrioritySendDataCollection.Clear() - called from finalizer in error paths.

Diagnosability: Log the DllNotFoundException in WSManAPIDataCommon ctor and also include it as the internal exception when throwing PSRemotingTransportException.
2018-01-04 13:08:33 -08:00
Dan Travison b057d4545d Build: Update Restore-PSPester to include the fix for nested describe errors (#5771)
Update Restore-PSPester to include PR PowerShell/psl-pester#12 that fixes PowerShell/psl-pester#11 - unhandled exceptions in before/after bypasses Pester's enddescribe logic.  
Update to the latest, while we are at it.
2018-01-03 15:44:25 -08:00
Chris 5f171963b5 Fail AppVeyor Build if MSI does not build (#5755)
Before this PR, when a WiX compilation error occurs then an error is thrown, which appears in the log with details but the AppVeyor build itself is still marked as green.
This PR makes the console host also return an exit code of -1 when being run on AppVeyor so that it can then interpret it as a build failure and mark the build as red. It uses the fact that AppVeyor defines an environment variable named CI. Exiting is OK since the MSI build is the last step in CI and nothing happens after that.
The git history shows a test build that proves that this works if the installer was broken.
2018-01-02 15:08:32 -08:00
Chris 238ff90d72 Cleanup temporarily created WiX files after compilation to be able to have a clean re-build (#5757)
When changing the WiX installer locally and rebuilding the MSI one can get into the terrible situation whereby a code change does not get compiled into the new MSI.
This PR fixes the root cause of it, which is due to temporary WiX files that are created but not deleted after compilation and WiX then somehow decides to not recompile properly.

I also removed redundant parenthesis of surrounding code.
2018-01-02 11:33:43 -08:00
Travis Plunk 359a3f078e
tools: fix install-powershell for running during window setup (#5727)
Set the system path instead of the user path so that all users can use the installation
    If the required destination folder doesn't exist, create it
2018-01-02 11:13:31 -08:00
Dongbo Wang ad231a8a7f
Make minor fixes in Compiler to properly handle void type expression (#5764) 2018-01-02 09:25:29 -08:00
Ilya 7257404929
Add Count and Length properties to [PSCustomobject] (#5745)
Related #3671
•Add Count and Length properties to [PSCustomobject].
 Now following returns 1:
 ([pscustomobject] @{ foo = 'bar' }).Count
 ([pscustomobject] @{ foo = 'bar' }).Length
•Add tests
2017-12-28 10:15:06 +04:00
Dongbo Wang dab51c7f40 Automate the generation of release change log draft (#5712)
Create the module 'releaseTools.psm1' under 'tools' folder, which expose the function 'Get-ChangeLog' to generate a release change log based on the local commit history.
2017-12-20 16:43:33 -08:00
Mark Kraus 52cadf93c9 [Feature] Replace lee.io Tests with WebListener. (#5709) 2017-12-20 16:43:33 -08:00
Dongbo Wang c17a975683
Automate the generation of release change log draft (#5712)
Create the module 'releaseTools.psm1' under 'tools' folder, which expose the function 'Get-ChangeLog' to generate a release change log based on the local commit history.
2017-12-19 13:39:36 -08:00
Luke Anderson 077bf97d4c Change Github to GitHub in CONTRIBUTING.md (#5697)
Correct branding is important.
2017-12-19 11:21:40 -08:00
SwarfegaGit 65744fb30c Fixed incorrect release date on the changelog (#5698)
Was showing November but should be December.
2017-12-19 11:21:40 -08:00
Steve Lee 5058894be3 Add instructions to deploy win-arm build on Windows IoT (#5682) 2017-12-19 11:21:40 -08:00
Andrew 690e968509 Update the docker based release package tests (#5692) 2017-12-19 11:21:40 -08:00
Mark Kraus acf68f462c Replace Remaining HttpBin.org Tests with WebListener (#5665)
•Replaces all remaining test that rely on httpbin.org
•Adds Put, Post, Patch, and Delete tests to WebListener by means of routes to Get test and modifications to the Get controller.
•Adds responsephrase option to the Response test to accommodate error message tests
•removed redundant GET tests from irm and iwr tests.
•Fixed markdown linting errors in README.md for WebListener
2017-12-19 11:21:40 -08:00
Mark Kraus 79ae396917 [Feature] Replace lee.io Tests with WebListener. (#5709) 2017-12-19 08:29:46 +04:00
Luke Anderson 181ce37a9c Change Github to GitHub in CONTRIBUTING.md (#5697)
Correct branding is important.
2017-12-18 23:23:00 +04:00
SwarfegaGit 1ae5042965 Fixed incorrect release date on the changelog (#5698)
Was showing November but should be December.
2017-12-18 23:20:42 +04:00
Steve Lee 462833b76e Add instructions to deploy win-arm build on Windows IoT (#5682) 2017-12-15 14:05:20 -08:00
Andrew 57a4cfcac6 Update the docker based release package tests (#5692) 2017-12-15 13:59:12 -08:00
Travis Plunk 7924224f77 Merge branch '6.0.0-upstream' into merge_rc2_to_master
# Conflicts:
#	README.md
#	docker/tests/container.tests.ps1
#	test/tools/WebListener/Controllers/ResponseController.cs
#	test/tools/WebListener/README.md
#	tools/appveyor.psm1
#	tools/travis.ps1
#   docs/linux.md
#   CHANGELOG.md
2017-12-14 15:29:59 -08:00
Travis Plunk 02cc3db3fb
Update scripts and documentation with RC.2 version (#5688) 2017-12-14 13:15:19 -08:00