Commit graph

5730 commits

Author SHA1 Message Date
Christoph Bergmeister bb09b88390 Fix start menu folder clash of shortcut when x86 and x64 are both installed by appending " (x86)" for x86 to the . (#5826) 2018-01-10 18:18:44 -08:00
Travis Plunk db10411505
CimDscParser: Add better error message when a file is not found (#5838) 2018-01-10 18:16:41 -08:00
Travis Plunk a08f3241a3 Merge 6.0.0 into master
# Conflicts:
#	.github/Images/GitHub-PR.png
#	assets/Product.wxs
#	docs/installation/linux.md
#	docs/installation/macos.md
#	docs/installation/windows.md
#	test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
#	tools/metadata.json
2018-01-10 17:42:41 -08:00
Travis Plunk 05ed03154d
tests: fix function to test for docker OS due to change to use linuxkit for mac (#5843)
* Also, fix syntax issues to allow to work with released Pester
2018-01-10 16:37:51 -08:00
Danny Maertens bb6823d707 Add the breaking changes doc (#5620) 2018-01-10 14:18:21 -08:00
Dongbo Wang 2f818615be
Update ChangeLog.md for PowerShell 6.0.0 GA release (#5835) 2018-01-10 08:50:33 -08:00
Ilya b6f18e7101
Add a test for IValidateSetValuesGenerator in a module (#5830)
Add a test that has been skipped in PR #5702
2018-01-10 13:02:33 +04:00
Christoph Bergmeister 378e8d5678 Make Explorer context menu registry entries platform specific to allow side by side of x86 and x64. The main menu has a " (x86)" appended to the main menu. (#5824)
Make explorer context menu registry entries platform specific to allow them to work also when both x86 and x64 are installed. The main menu has a " (x86)" appended to the main menu as well.
2018-01-10 08:17:06 +04:00
Dongbo Wang c4cf1440dd
Update docs and scripts for PowerShell 6.0.0 GA release (#5837) 2018-01-09 15:57:38 -08:00
Greg Zimmerman 0ed28d00f4 Seperate macOS from Linux install instructions. (#5823) 2018-01-09 14:55:51 -08:00
Christoph Bergmeister d2863fc50d Reduce image file sizes using lossless compression with imgbot (#5808) 2018-01-09 14:51:57 -08:00
Mark Kraus bcb7252712 Convert WebCmdlets test to one-true-brace-style Formating (#5716) 2018-01-09 13:43:25 -08:00
Jason Shirk 8bd53786d1 Fix ValidateSet with generator in a module (#5702)
The symbol resolver was properly resolving the type to the class
definition, but that resolution was ignored at runtime because we used
the string instead of the ITypeName - the ITypeName kept the reference
to the class definition.

Fix #5661
2018-01-09 13:43:54 +04:00
Steve Lee 08c455a4ee Remove sc alias which conflicts with sc.exe (#5827) 2018-01-08 18:09:00 -08:00
Aditya Patwardhan 0687d5a564 Updated Help Uri to point to latest help content for Microsoft.PowerShell.Core module (#5820) 2018-01-08 18:09:00 -08:00
Christoph Bergmeister 087d4acf54 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.

# Conflicts:
#	assets/Product.wxs
2018-01-08 18:09:00 -08:00
Andrew 92e140ad97 Update the installation doc for Raspberry-Pi about supported devices (#5773) 2018-01-08 18:09:00 -08:00
Mark Kraus 9e6115c9c6 Fix a typo and a Markdonw linting error in the Pull Request Template (#5807) 2018-01-08 18:09:00 -08:00
Dongbo Wang 658960e3f9 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 18:09:00 -08:00
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