Commit graph

379 commits

Author SHA1 Message Date
Travis Plunk 49ec403899
fix MSI creation errors, and capture wixpdb for later patch creation (#6221)
- add `wixpdb` output when creating `MSI` package
- capture `wixpdb` in official build
- clean up anything left behind from previous MSI builds before starting MSI build to prevent using dirty files.
- make sure MSI creation fails if there is an error
- ignore `.wixpdb` files in git
- Add functionality to `Start-NativeExecution` to 
    - only display output if there is an error 
    - log caller information
- WXS validation error fixes
    - Remove unused `ExitDialog` to fix ICE82
    - Add KeyPath to `SetPath` to fix ICE18
    - Use `HKMU` which translates to `HKLM` to runtime to fix various validation errors about creating the shortcut
- Suppress Validation errors
    - suppress ICE61, which is about same version upgrades being allowed
    - suppress ICE57, caused by the shortcut not being installed per user
2018-02-26 15:45:15 -08:00
Mark Kraus 16d7a62195 Use TLS 1.2 in Start-PSBootStrap Without Breaking HTTPS (#6236) 2018-02-24 12:05:49 -08:00
Joel Joseprabu a7271804f9 Uses TLS 1.2 on Windows during Start-PSBootstrap (#6235)
* Fixed TLS version error on Windows when building PowerShell
2018-02-24 11:01:37 -08:00
Travis Plunk 9a46b3f3c0
Refactor new-msipackage into packaging.psm1 (#6208)
Refactor new-msipackage and related function into packaging.psm1
2018-02-22 13:31:00 -08:00
Klaudia Algiz 17b501c9fa Support running tests in root privilege on Linux. (#6145)
Support running tests in root privilege on Linux by adding the `REQUIRESUDOONUNIX` tag.
- Delete skip tag in tests which require `sudo`.
2018-02-16 11:13:23 -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
Dongbo Wang c0cb240ebd Update 'Restore-PSPester' to use 'Save-Module' (#6112)
Update Restore-PSPester to use 'Save-Module' to get the latest version of Pester.
We have moved to the latest version of Pester via PR #6064
2018-02-07 13:44:29 -08:00
James Truher [MSFT] 99a7d38cae Update test framework and tests to support 4x version of Pester (#6064)
* Test fixes and changes needed to support Pester 4.0.8

* Replace 'Should Contain' with new 'Should FileContentMatch' assertion

Explicitly check for string creation with write-output

* Use the current version of pester and install it in modulesDir

* Simplify logic for relative path test.

Multiple '..' is not needed for a relative path, a single one will do. Also, on multi-drive systems using split-path -noqualifier will probably do the wrong thing with regard to constructing a correct path.
Remove extraneous Should Not Throw test, if this throws, the test will fail, we don't need to explicitly assert the not throw

* In some environments it is possible that computer name is 'localhost', so that should be allowed

* [feature] Add link for migrating tests from Pester v3 to v4

Fix up capitalization and white space issues
Change one test to check FullyQualifiedErrorId rather than just `Should Throw`

* [feature] update invoke-item test to handle the case where multiple notepad processes are running

* Fix spelling issue with Pester 4x, calling it Pester 4 should be sufficient
2018-02-05 11:58:25 -08:00
Ilya 05ca36463a Build: Update PowerShell to build with .NET Core SDK 2.1.4 (#6054) 2018-01-31 14:56:20 -08:00
Aditya Patwardhan 5b5168d72e Revert "Pull PSReadLine from PSGallery" (#5986)
This reverts commit beffdcf94d.
2018-01-22 16:09:35 -08:00
Thomas Conté 7dcd4c83d9 Fix build/package/installation scripts for SLES (#5918)
Small changes to the SUSE installation script so that it allows installing on SLES 12+ in addition to openSUSE 42+
2018-01-22 14:58:17 -08:00
Jason Shirk beffdcf94d Pull PSReadLine from PSGallery (#5759)
Instead of building PSReadLine from this repo, pull it from the gallery using nuget cache.

This pulls v2.0 of PSReadLine which does have documented breaking changes from v1.2, but the risk is small - the features that have changed are typically only used in a profile and aren't used all that often anyway.

Fix #996

Hardcodes version of modules pulled from PSGallery
2018-01-19 18:15:09 -08:00
Christoph Bergmeister c6be7bd863 Update recommended WiX toolset link to be generic to WiX 3.x but mention that latest version of 3.11 has to be taken (#5926)
* Update recommended WiX toolset link to be generic to WiX 3.x but mention that the latest version of 3.11 has to be taken.
2018-01-17 16:42:45 -08:00
Christoph Bergmeister d3a775da9a Packaging: simplify building an installable package for Windows (#5871)
This is the continuation of PR 5499 that had to be abandoned due to a fatal merge conflict and I did not want to risk accidentally reverting recent fixes.

    Remove unnecessary/unused default for productGuid because it always gets a new Guid when being called from Start-PSPackage
    Add defaults for required files but also add extra path validation attribute
    Rename ProductGuid to ProductCode
2018-01-17 15:34:03 -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
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 117e83a025 Add xUnit tests for reading Policy settings from config file 2018-01-04 13:40:51 -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 6ef94c1dfe
Make the experience better when start-pspester doesn't find pester (#5673)
refactor code to restore pester into a separate function called Restore-PSPester
update message on what to do when pester is missing
Add ability for get-psoptions to default to new-psoptions
fix an issue with publish-pstesttools when a build has not been run since build.psm1 has been imported (try to use the default options)
make start-pspester use the last build, not just use the default options
fix an issue in restore caused some files not to be removed
2017-12-12 16:07:12 -08:00
Steve Lee eb254280fb build: Enable building for win-arm and win-arm64 (#5524)
* enable win-arm and win-arm64 builds

* fix using arm64 tools for build
fix finding vs2017 dynamically

* change install-powershellremoting.ps1 script to use reg provider rather than reg.exe so that error doesn't show on success
fix formatting issue in cmake.defs

* add check that path being read from config file is valid
address PR feedback

* fix copying of PowerShell.Core.Instrumentation as VS2017 puts it in $HOME/source
address PR feedback
2017-12-08 15:43:53 -08:00
Mark Kraus ee7fbed23c Make Travis CI use libcurl+openssl+gssapi for macOS (#5629) 2017-12-06 12:20:44 -08:00
Travis Plunk 41cc640201
build: fix git error in appveyor (#5631)
Add --quiet to git checkout which should resolve error message displayed in AppVeyor
2017-12-05 15:51:46 -08:00
Travis Plunk 25617f15c2 build: unbundle pester (#5623)
* remove pester module

* restore Pester as a module only in CI build from the git repo

* mark appveyor builds as CI builds

* remove pester exclusions

* mark travis builds as ci

* exclude publish folder from spell check

* do not run spell check on publish folder
2017-12-04 17:16:53 -08:00
Mark Kraus ec8b849c47 Fix Get-EnvironmentInformation IsCoreCLR logic (#5592)
* Fix Get-EnvironmentInformation IsCoreCLR logic
Replace $Runtime = [System.Runtime.InteropServices.RuntimeInformation]  and $OSPlatform = [System.Runtime.InteropServices.OSPlatform]  with ($PSVersionTable.ContainsKey("PSEdition") -and $PSVersionTable.PSEdition -eq "Core").
2017-12-02 15:39:04 +04:00
Chunqing Chen 52df947080 Fix xunnit test for PS (#4780)
* Initial work to enable xunit

* Moved AssemblyOriginatorKeyFile to csharp.tests.csproj

* Native binary has dylib extension on macOS
2017-11-30 14:44:41 -08:00
Ilya d8e1f8dff3 Fix the path to 'powershell_xxx.inc' in Start-Build (#5538) 2017-11-24 02:42:41 -08:00
Travis Plunk 90f455b9ec
fix MSI version parsing (#5475) 2017-11-15 18:43:14 -08:00
Dongbo Wang 97511a9e2a
Fix the regex for '-ReleaseTag' (#5473) 2017-11-15 16:55:13 -08:00
Steve Lee 2f8e691e05 Fix build in vscode (#5453)
- Fix build in vscode
- Add v2.0.0 tasks.json thanks to Keith Hill
- Add '/property:GenerateFullPaths=true' to build to fix the $mscompile 'problem matcher' not working issue.
2017-11-15 11:40:49 -08:00
bergmeister 019cfee82c Fix Start-PSBuild on WSL if repository was already built on Windows (#5346)
Replace the static `powershell.inc` filename with a name based on the current RID, so that the build doesn't confuse when running in the same local repository on WSL.
2017-11-15 10:52:06 -08:00
Travis Plunk 3c7cd11152 Get PowerShellGet from the PowerShell Gallery (#5452) 2017-11-15 10:19:25 -08:00
Dongbo Wang c4f0d1c893
Add a test for the powershell hang fix (#5451)
- Add test for the powershell hang fix
- Ignore the 'Sync-PSTags' warning
2017-11-15 09:41:11 -08:00
Travis Plunk 1d64cad068
Signing fixes (#5439)
* Add two files that need to be signed
* make sure to set PSModuleRestore to true when expanding a signed build because we run PSModuleRestore at that point.
* suppress output of CmdLets which are noisy
2017-11-14 10:30:17 -08:00
Travis Plunk 36fac11f29 Allow packaging from a zip package to allow for signing (#5418)
- Include a serialized version of PSOptions in an includesymbols zip
- Add a function which will create a zip package from the expanded includesymbols zip and a folder of signed files
- Add a function to restore an includesymbols zip as a build and populated PSOptions with the options
2017-11-13 10:10:51 -08:00
Steve Lee 0f223c00d2 Move the 'rcedit' step to build rather than packaging (#5404) 2017-11-11 10:32:10 -08:00
Dongbo Wang affcc40a52
Add 'install-powershell.ps1' to install powershell core on windows (#5383)
- Add install-powershell.ps1 to install powershell core packages on windows.
- Update Start-PSBootStrap to check and install the latest PSCore package on Windows.
2017-11-10 08:28:02 -08:00
Keith Hill 34600c4100 Update Find-Dotnet to find dotnet with compat SDK (#5341)
Fix #5260 - with this fix folks shouldn't hit the version mismatch check.

The approach is to see if the dotnet in the current PATH has a compatible SDK.  Folks will have a globall installed dotnet if they've installed VS, VSCode C# ext or have  installed the .NET Core SDK.  This verion may not have the SDK required by PSCore.  And the global cannot see user local dotnet SDK installs.  So if the global dotnet doesn't have the right SDK, we prepend the path to the user's local dotnet dir.

Also, updateed $dotnetCLIRequiredVersion to read its value from global.json so there is one less source of the truth (for the SDK version).
2017-11-09 16:28:39 -08:00
Dan Travison 3bfae4f1dd Rename/Update PowerShell ETW manifest to remove the Windows PowerShell dependency. (#5360)
- Build PowerShell.Core.Instrumentation.dll - Resource-only binary for the ETW resources.
- Create a registration script for registering/unregistering the ETW provider.
2017-11-09 09:23:00 -08:00
bergmeister 6b700bbcc6 Update Wix toolset download link to newer version 3.11 (#5339)
This makes it also future proof since codeplex is going to get deprecated.
2017-11-06 10:32:00 -08:00
Dongbo Wang ef00088ade
Separate Install-PowerShellRemoting.ps1 from psrp.windows nuget package (#5330) 2017-11-03 14:45:07 -07:00
Dongbo Wang decdd1a828 Update powershell to use 2.0.4-servicing dotnet core runtime (#5295) 2017-11-02 14:12:19 -07:00
Travis Plunk 8fcdc01827
Refactor for signing (#5300) 2017-11-02 13:52:17 -07:00
Steve Lee beef5bc84a set requestedExecutionLevel to asInvoker for pwsh.exe on Windows (#5285) 2017-11-01 14:12:39 -07:00
Steve Lee 4df703616a use rcedit to embed icon and version information into pwsh.exe (#5178)
pwsh.exe today doesn't contain file version information and the icon is only associated with the shortcut file and not the exe

Fix is to use rcedit to embed:

icon
product version
file version
product name
copyright
Fix #2883
Fix #5166
Fix #5034
2017-10-26 21:52:08 -07:00
Aditya Patwardhan d0806811e4 Update docs and scripts for beta.9 (#5217) 2017-10-24 16:28:22 -07:00
Steve Lee 2cc091115b Rename powershell.exe to pwsh.exe (#5101)
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
2017-10-17 17:25:11 -07:00
PetSerAl cd7ac4d436 Try to locate dotnet before installing it (#5059) 2017-10-10 14:01:01 -07:00
David Weber 42e8deb969 Add warning to Start-PSPester if Pester module not found (#5069)
Currently, if a user does not clone with the `--recursive` flag or run `git submodule update --init`, `Start-PSPester` will fail to run due to the missing Pester module. While the error hints at the Pester module not being found, there is no suggested way of fixing the issue presented to the user.
This change makes a helpful warning to appear at the beginning of the execution of `Start-PSPester` if the Pester module cannot be found.
2017-10-10 12:37:17 -07:00