Commit graph

572 commits

Author SHA1 Message Date
Travis Plunk 058a19028d
Refactor macOS CI so that tests run in parallel (#9056)
Refactor macOS CI so that tests run in parallel 
  - Also:
    - Fix bootstrap issue where curl was failing for a month (so obviously not needed)
    - Change Windows test stages to use PowerShell Core (where we can) to avoid compat issues

## PR Context

This allows running all tests in about the same about of clock time.
2019-03-11 13:00:22 -07:00
Aditya Patwardhan fb05169a51
Build Global tool for PowerShell and SDK container (#8984)
* Add shim dll to redirect to appropriate runtime
* Build updates for creating global tool package
* Add building global tool to nuget.yml
* Add azure upload of nuget packages
2019-02-26 12:56:29 -08:00
Dongbo Wang 5d54f1aa38
Make xUnit tests run sequentially to avoid race conditions caused by manipulating 'powershell.config.json' in tests (#8945) 2019-02-22 11:57:10 -08:00
Reece Dunham 9bfbd78a3e Remove Travis-CI mention in build.psm1 (#8888) 2019-02-19 17:47:35 -08:00
Travis Plunk a7f798575d
Parallelize the windows CI to enable us to run all tests all the time (#8868)
Split Windows CI into the following Jobs

1. Combine Build and xUnit, which published build artifact
1. Elevated CI tests
1. Unelevated CI test
1. Elevated everything else tests
1. Unelevated everything else tests
1. Package build and test
1. Verify xUnit result

## PR Context  

Before this test:

- A CI run would take ~14 minutes
- A Feature run would take ~30 minutes

After this change, it always runs all tests and takes ~20 minutes.
Job `Unelevated everything else tests` is the long poll, taking ~4 minutes longer than the next shortest job.  We should be able to get this back down to ~15 if we split that test job somehow.
2019-02-14 16:33:19 -08:00
Steve Lee 53ad39772c Use -ErrorAction Ignore instead of SilentlyContinue with Get-Command in build.psm1 (#8832) 2019-02-06 12:00:57 -08:00
James Truher [MSFT] bbcedd2590 Update Pester version to 4.4.4 (#8739) 2019-01-31 11:41:26 -08:00
Travis Plunk f416fd3815
Switch to 1.11 of FPM to fix FPM install issue (#8797)
Switch to 1.11 of FPM to fix FPM install issue
2019-01-30 11:08:08 -08:00
Travis Plunk b779b88c79
Merge `release-v6.2.0-preview.4'
# Conflicts:
#	test/Test.Common.props
#	tools/packaging/packaging.psm1
2019-01-28 13:50:00 -08:00
Reece Dunham e5897ba2f7 Fix broken reference (#8753) 2019-01-28 17:00:34 +05:00
xtqqczze 863528881f Use https in URLs where available (#8622)
Use https in URLS across the repository where the domain serves content by https.
2019-01-24 12:50:11 -08:00
Aditya Patwardhan ea0b4de90a
Merged PR 6442: Moved the cleanup logic to Restore-PSModuleToBuild
Moved the cleanup logic to Restore-PSModuleToBuild

# Conflicts:
#	build.psm1
2019-01-23 12:27:44 -08:00
Travis Plunk c4b2105a73 Merged PR 6648: Bump SDK and Runtime Versions
Bump SDK and Runtime Versions
  - Also, fix alpine docker file
  - Also, fix extra files being added to some Modules after these changes
2019-01-23 02:18:44 +00:00
Christoph Bergmeister [MVP] beae5691aa Do not ship fullclr binaries of PackageManagement (#8700)
## PR Summary

Related: #8699

## PR Context  

Because `PowerShellGet` does not support publishing/saving module on a per platform basis (see [this](https://github.com/PowerShell/PowerShellGet/issues/273) issue), PowerShell currently also ships the fullclr binaries of `PackageManagement`, which it does not need. Therefore removing it to minimise the package size, this saves 1.19 MB.
2019-01-22 12:55:22 -08:00
Travis Plunk f1218bd3d9
Remove Debian 8 references as it is EOL (#8678)
Remove Debian 8 references as it is EOL
2019-01-17 16:30:39 -08:00
Aditya Patwardhan f03cafbdd8 Build package build using ubuntu 18.04 image (#8666) 2019-01-16 15:10:39 -08:00
Travis Plunk 7bf4641444
Fix broken urls (#8653)
Fix broken URL
  - Also, move other static analysis tests into that CI.
  - Also, make the link analysis a pester test (partly to make sure the step fails in case of an error)
2019-01-15 16:20:45 -08:00
Dongbo Wang ab75626f22 Fix installing fpm and ronn in macOS CI by avoid installing docs for them (#8656) 2019-01-15 14:23:59 -08:00
Ilya a9f106da58 Move xUnit tests in new folder (#8356)
## Motivation

I have a PR where there are many new xUnit tests.
It would also be useful to create new xUnit tests for public APIs.
The number of xUnit tests will increase and their ordering is required.

## PR Summary

- Move C# xUnit tests in new folder. This allows to put new xUnit tests in directory structure in accordance with directory structure where cs files are.
- Use an xUnit TestCaseOrderer attribute to sequentially process tests for `powershell.config.json`.
- Update README.md
- A race condition was fixed which allowed  to run all XUnit tests in single batch job.
2018-12-13 14:22:07 -08:00
Alex Earl 74de391193 Add Linux ARM64 build support (#8016) 2018-12-05 10:55:09 -08:00
Dongbo Wang a11810bf33
Improve powershell startup time (#8341)
Major changes are as follows:
- Avoid `SecuritySupport.IsProductBinary` and unnecessary AMSI/suspicious code scan at startup time
   - Update `CompiledScriptBlockData.IsProductCode` to avoid unnecessary calls to `IsProductBinary`, which attempts to retrieve catalog signature of the target file.
   - Update `PerformSecurityChecks` to skip AMSI and suspicious code scan for the `.psd1` file that contains a safe `HashtableAst` only.
- Use customized `ReadOnlyBag` instead of `ImmutableHashSet` so that we can avoid loading the `System.Collections.Immutable.dll` completely.
- Replace `SHA1` with `CRC32` when generating module analysis cache file name
   - This remove the loading of `System.Security.Cryptography.Algorithms.dll` at startup
- Move `ConvertFrom-SddlString` to C# to remove the `Utility.psm1` file.
- Crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation
   - Even pwsh with crossgen assemblies spends a lot time in jitting at the startup, about `191.6ms` comparing with `24.7ms` for Windows PowerShell.
   - Jitting `Microsoft.ApplicationInsights.dll` takes about `51.6ms`.
   - By crossgen `Microsoft.ApplicationInsights.dll` and enable tiered compilation, the jitting time drops to about `98.9ms`.
2018-12-02 12:52:39 -08:00
Aditya Patwardhan 3794a5e39f
Created a csproj to pin test modules and updated build.psm1 accordingly (#8350) 2018-11-30 11:49:38 -08:00
Aditya Patwardhan b0daa1e724 Build Alpine tar.gz package in release builds (#8340)
Enable building tar.gz package for Alpine in release builds.

## PR Checklist

- [x] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
    - Use the present tense and imperative mood when describing your changes
- [x] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] [Change is not breaking](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)
- [x] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
- [x] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress).
    - If the PR is work in progress, please add the prefix `WIP:` to the beginning of the title and remove the prefix when the PR is ready.
- **User-facing changes**
    - [x] Not Applicable
    - **OR**
    - [ ] User-facing [Documentation needed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission)
        - [ ] Issue filed - Issue link:
- **Testing - New and feature**
    - [x] Not Applicable or can only be tested interactively
    - **OR**
    - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting)
        - [ ] [Add `[feature]` if the change is significant or affects feature tests](https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr)
2018-11-27 10:45:49 -08:00
Aditya Patwardhan 9fda1d0e4f
Publish test package to AppVeyor daily build (#8273) 2018-11-26 10:44:42 -08:00
Andrew Menagarishvili 42cfa2c0b1 Merged PR 5863: Lowering Pester module version to avoid test infra failures on some Linux systems
Without this change package validation tests fail during Pester module import on some Linux systems.
2018-11-15 21:26:11 +00:00
John Eismeier 4118fd2829 Propose fix some typos (#8206) 2018-11-09 08:33:24 +05:00
Aditya Patwardhan e1d8765f9e Add function to create a new nuget.config file (#8170)
Add a function to create a NuGet.config file to consume packages  from the specified feed URL using the specified credentials.  

  - Also, exclude the `nuget.config` file under `src/Modules` from being clean by `Start-PSBuild -clean`
2018-11-05 10:48:05 -08:00
Andrew Schwartzmeyer 54874180ce Remove build and doc references to Git submodules (#8177)
As of #7892, the PowerShell repository no longer uses Git submodules.
This is fantastic from a workflow standpoint, and so all the notes about
how to deal with submodules (and all the build steps explicitly
initializing and updating submodules) can be safely removed.
2018-11-05 10:39:29 -08:00
PRASOON KARUNAN V 35f1ed0011 Use approved verb instead of Generate-CrossGenAssembly (#8151) 2018-10-31 15:45:33 +05:00
kwkam a4d4c31390 build: fix Start-PSBuild -Output (#7504)
Make Start-PSBuild -Output $OutDir output the build to the directory properly.
2018-10-29 17:43:41 -07:00
Aditya Patwardhan d7c7fa504f
Filter the TestPackage artifact upload by name to avoid other zip files being uploaded (#8116) 2018-10-29 14:13:05 -07:00
Aditya Patwardhan 05e9f78bcb
Publish test package at AGENT_WORKFOLDER if TEMP is not available (#8108) 2018-10-23 16:31:04 -07:00
Steve Lee ef504e5212 Fix psmodulerestore path when built in VSCode (#8075) 2018-10-20 11:38:15 -07:00
Aditya Patwardhan 487073e57b
Add functionality to create a test package (#8087) 2018-10-19 14:56:58 -07:00
James Truher [MSFT] ddaffe23c6 Update Pester to use latest version (#8015) 2018-10-12 15:31:33 -07:00
Christoph Bergmeister [MVP] fe731eda14 Use dotnet test since the dotnet xunit test runner has been deprecated (#7980) 2018-10-09 20:55:41 -07:00
PRASOON KARUNAN V 112b485798 Converting aliases to cmdlets in 'build.psm1' (#7964) 2018-10-08 23:16:50 -07:00
Steve Lee abaf18680a Change default of Start-PSBuild to include -PSModuleRestore (#7881) 2018-10-03 12:49:24 -07:00
Aditya Patwardhan b42c001700 Cleanup all native code from repository (#7892)
Native code for PowerShell has been moved to repository PowerShell/PowerShell-Native.

Hence, removing all the native code and related build components.
2018-10-02 12:48:42 -07:00
Robert Holt 649d342a07 Replace test certificates with self-signed certificate generating command (#7875) 2018-10-01 14:40:48 -07:00
Aditya Patwardhan 8d4dd1e58f Remove packaging, building and installation scripts for Ubuntu 17.10 (#7773) 2018-09-17 14:48:23 -07:00
Aditya Patwardhan abad087fa1 Build and package framework dependent package (#7729)
Add the functionality to build a framework dependent (shared framework) package for PowerShell.

The changes create two packages, one for Windows and other for Linux, due to #if code.
2018-09-10 12:47:32 -07:00
Travis Plunk 2141c2a8e3
Add daily build non-windows platforms (#7683)
Add daily build non-windows platforms
  - Also, make the [Feature] tag work in VSTS for non-windows
  - Also, add a way to force feature tests to run
  - Also, fix an issue where `-workingdirectory` didn't work when running async
2018-09-06 12:27:49 -07:00
zhenggu 358e8abefe Fix Set-Service -Status Stopped to stop services with dependencies (#5525) 2018-08-28 11:03:12 -07:00
Dan Travison 1abf290f83 Add symbolic links for libssl and libcrypto to Debian 9 builds to make remoting work. (#7609)
On Debian 9, libmi cannot resolve libssl and libcrypto. This change adds symbolic links to packaging and build to the $PSHOME directory to resolve the issue.

The fix was verified interactively connecting to office 365, importing the session, and ensuring Get-MailBox and Get-User succeed.

Fix #7598
2018-08-24 15:20:22 -07:00
Travis Plunk 40532d9a2e
Add VSTS CI for Windows (#7536)
- Add VSTS CI for Windows
    - Disable `Access-denied test for Get-Item C:\windows\appcompat\Programs\Install -ErrorAction Stop`, because the path does not always exist
        - https://github.com/PowerShell/PowerShell/issues/7553
    - Disable `Should give .sys file if the fullpath is specified with hidden and force parameter`, because pagefile.sys doesn't always exist and other files don't meet test's requirement.
        - https://github.com/PowerShell/PowerShell/issues/7554
    - Disable some `Test-Connection` tests for same reasons they failed on VSTS Linux
        - https://github.com/PowerShell/PowerShell/issues/7555
    - Disable `Test-FileCatalog should pass when catalog is in the same folder as files being tested`, because the CmdLet does not work in that scenario
         - Also, give details needed to investigate when the test fails
         - https://github.com/PowerShell/PowerShell/issues/7556
    - Update `appveyor.psm1` to work with VSTS
    - Update `HelpersRemoting.psm1` `New-RemoteSession` to work for CimSession (discovered an issue during the investigation)
    - Update `Test wildcard with drive relative directory path` to work when there are multiple drives
         - Disable on non-windows machines since the test is assuming drive letters
    - Update `New-CimSession` Tests to requireAdmin
         - Also, make sure session name is a string
    - Add functions to save and restore psoptions
    - update `.gitatttributes` so files clone like they do on appveyor
2018-08-17 22:06:51 -07:00
Travis Plunk bfd46b1a3f
make sure we continue with retry loop when we get an error (#7550)
Improve logging
2018-08-16 17:24:41 -07:00
Aditya Patwardhan 4866b5f326 Fix typo on environment checker for RedHat (#7549) 2018-08-16 16:44:20 -07:00
Aditya Patwardhan 5232bb4890 Fix typo in environment checker (#7547)
Fix error in environment checking logic for RedHat family.
2018-08-16 16:18:34 -07:00
Travis Plunk 01634e4b2e Retry restore on failure (#7544)
* switch to using a retry
2018-08-16 14:23:30 -07:00
Travis Plunk 0a1a47e8b0
Make sure we do not upload artifacts during a pull request (#7535) 2018-08-16 13:11:24 -07:00
Travis Plunk 4acf1038a1
Only remove the revision if it is 0 from module version when restoring modules (#7538) 2018-08-15 21:53:00 -07:00
Travis Plunk 965552873c
Add Linux VSTS CI (#7527)
Update Start-PSPester and Start-PSxUnit to upload test results when running in VSTS
Disable tests which require non-root using when running as root
remove verifications in Test-Connection tests which verify buggy behavior
Skip tests which don't behave correctly in VSTS (due to running in a container?)
- Test-Connection - #7528
- Set-Date - #7529
2018-08-14 16:23:50 -07:00
Aditya Patwardhan ee33db0798 Fix building on RedHat Enterprise Linux (#7489)
When trying to build on RHEL, the environment is not recognized as RedHatFamily.
Added detection logic so that appropriate symbolic links are generated.
2018-08-14 13:21:26 -07:00
kwkam 820286e117 Build: Also search PATH for rcedit (#7503) 2018-08-14 10:17:29 -07:00
Steve Lee 769b02ab98 Save modules to un-versioned folder to enable servicing (#7518)
Remove code from build.psm1 that save the modules to a versioned folder. For servicing reasons after release it is preferred and easier to not have the versioned folder so that we can directly replace modules that need to be serviced (MSI specifically makes it difficult to service a module if the folder path changes).
2018-08-14 10:15:05 -07:00
Travis Plunk b5acb298a4
workaround xunit test crash on VSTS (#7516) 2018-08-13 16:18:49 -07:00
Dongbo Wang 25c127c3bc
Update CI scripts to support running tests for experimental features (#7419) 2018-08-03 11:20:14 -07:00
Dan Thompson e7c315b65c Start-DevPowerShell: add -Configuration and handle -ArgumentList more properly (#7300)
- Allow specifying the configuration, rather than the `bin` folder.
- Do not attempt to pass null/empty `ArgumentList` to `Start-Process`.
2018-07-26 10:30:05 -07:00
Christoph Bergmeister [MVP] ef10460172 Make 'Start-PsBuild -Clean' not prompt due to locked files when Visual Studio is open by excluding sqlite3 folder and use -x instead of -X option on git clean (#7235)
* Exclude sqllite  folder when cleaning and use -x instead of -X option

* Remove 2nd git clean block which is redundant now
2018-07-09 10:16:56 -07:00
Dongbo Wang 73d71d9a9c
Build: Fix the source location of PowerShell.Core.Instrumentation.dll (#7226) 2018-07-03 18:05:57 -07:00
Christoph Bergmeister 56e50ce632 Update 'Start-PSPester' to make it more user friendly (#7210)
- Make `Start-PSPester` call `Restore-Pester` automatically when needed,
- Make `-Path` a positional parameter for `Start-PSPester`.
2018-07-03 11:16:37 -07:00
PetSerAl b12dce27ff Build: Fix a check to avoid null argument in case 'vcvarsall.bat' is absent (#7218) 2018-07-02 10:41:03 -07:00
Steve Lee 167b51c4d6 update build and packaging modules for Alpine (#7149) 2018-06-27 15:30:38 -07:00
Christoph Bergmeister 0487a1be2f Disambiguate icon on Windows for preview builds/installers to use Powershell_av_colors and make daily build use Powershell_avatar instead (#7086)
Closes #6317
Using the preview side-by-side with the RTM version is a pain/confusing due to the icons being the same.
This makes the preview build (i.e. the embedded icon in `pwsh.exe`) and MSI installer package (shortcut icon and context menu) use the [Powershell_av_colors icon](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_av_colors.ico)
![image](https://user-images.githubusercontent.com/9250262/41491336-6e354936-70f0-11e8-965e-9b5e83be925b.png)

Therefore change the icon of the daily build (which used to use the Powershell_av_colors icon) to [Powershell_avatar](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_avatar.ico)
![image](https://user-images.githubusercontent.com/9250262/41491346-80f890a0-70f0-11e8-9ab5-bb789454c134.png)
This means that people like me who have a shortcut to pwsh of the daily build pinned to the taskbar, probably need to re-pin it to the taskbar to receive all changes (otherwise one will only get the change in the icon of the window)

Note: The `Test-IsPreview` method had to be moved to the build module, which is OK because the packaging module has a declared dependency on the build module in its manifest.
2018-06-18 15:54:11 -07:00
Travis Plunk f08a031f88 Merged PR 3079: Resolve Linux SxS conflicts and issues
Fix man page conflict between stable and preview Linux package
  - rename preview man page pwsh-preview
Fix /etc/shell entries not being created correctly for preview packages
2018-06-08 23:31:38 +00:00
Travis Plunk b869f1b168 Get the fix for this issue with installing fpm
https://github.com/jordansissel/fpm/pull/1494
2018-06-06 12:15:33 -07:00
Steve Lee 92cb949cac Use PSReadLine 2.0.0-beta2 from PSGallery (#6998)
Removed building PSReadLine from the repository. Instead, change to downloading from PSGallery.
2018-06-06 09:42:19 -07:00
Klaudia Algiz 4070d51ee1 Add functions into build.psm1 to Save and Restore PSOptions between different sessions. (#6884)
Add functions into build.psm1 to Save and Restore PSOptions between different sessions.
2018-05-17 19:04:20 -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
Aditya Patwardhan d07a3e7c2f
Add functions to merge Pester and Xunit logs (#6854) 2018-05-10 17:46:45 -07:00
Dongbo Wang 1de9fb5589
Fix build.psm1 to not add tool path to $PATH twice (#6834) 2018-05-08 09:20:39 -07:00
Robert Holt d96a321b49 Change packaging to support Ubuntu 17.10 and 18.04 (#6769)
Ubuntu 17.04 is EOL, so we need to update our packaging for Ubuntu 17.10. This updates the package script and build.psm1 to use 17.10 rather than 17.04.
2018-05-07 12:30:58 -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
Klaudia Algiz e9b045e819 Update Start-PSPester and Restore-PSPester cmdlets in build.psm1 to check for Pester 4.2 (#6667)
Update Start-PSPester and Restore-PSPester cmdlets in buil.psm1 to check for Pester 4.2 to support exception passthru.
2018-04-27 15:34:54 -07:00
Steve Lee f760fde0b7 Remove support for file to opt-out of telemetry, only support env var (#6601)
Since a PR added support to opt out of telemetry via an environment variable, we can remove the,
always intended to be a temporary, solution of deleting a file to opt out of telemetry since the
environment variable can be defined at the system level and exist before even installing PowerShell Core.

Because the variable is defined as opt out, a value of true, yes, or 1 means no telemetry is sent.
2018-04-13 10:29:39 -07:00
Travis Plunk aefc0d89b0
make gem use sudo for macOS (#6610)
gem install requires sudo on official macOS build VMs.
- make bootstrap use sudo for macOS
2018-04-10 12:18:11 -07:00
Dongbo Wang 9e3ffb10e5
Remove duplicate 'Restore-PSPackage' (#6544) 2018-04-02 13:38:49 -07:00
Steve Lee c18b9999d6 Enable [Environment]::OSVersion to return current OS rather than compatible version (#6457)
* add application manifest dictating compatibility so that osversion shows appropriate os version on Windows
2018-03-28 13:36:16 -07:00
Aditya Patwardhan d301e62d3a
Merge pull request #6484 from PowerShell/release-v6.1.0-preview.1
Release v6.1.0 preview.1
2018-03-26 13:17:05 -07:00
Aditya Patwardhan 60911df907 Fix release packaging build (#6459)
The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules
2018-03-22 11:37:54 -07:00
Aditya Patwardhan 942832c13a
Fix release packaging build (#6459)
The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules
2018-03-22 11:22:16 -07:00
Dongbo Wang c33e1ff828
Make '-CI' not depend on '-PSModuleRestore' in 'Start-PSBuild' (#6450) 2018-03-21 14:24:44 -07:00
Travis Plunk 982dbfe552
fix errors in start-psbootstrap during release builds (#6159)
set Debian front end to non-interactive during apt-get commands, to avoid error with prompting
add libffi-dev, which is required for ruby/fpm
let fpm update to the latest
2018-03-12 15:59:58 -07:00
Dongbo Wang dcba3c486e
Specify the runtime when running 'dotnet restore' in 'Start-PSBuild' (#6345) 2018-03-08 14:25:39 -08:00
Dan Travison 0c845b94c7 Rename log and logerror to Write-Log [$message] [-error] (#6333)
Fix #6332
This change renames log and logerror functions to a single Write-Log [$message] [-error] function to avoid conflicting with the log command on MacOS.
2018-03-08 10:47:20 -08:00
Travis Plunk 28bf189e6e Exclude lines about Pester executing test scripts from terse logs (#6336) 2018-03-08 10:17:23 -08:00
Travis Plunk 1426e24541
Build: Only restore once (#6335)
* don't restore with every publish
2018-03-08 10:01:19 -08:00
Dongbo Wang 76b1b1c9e6
FixBuild: Revert the changes to get Pester from NuGet cache (#6282)
Attempt to fix the macOS build.
In #6263, I tried flushing the cache and it worked in the PR. However, after merging the PR, it turns out the master CI build failed again with the same Pester package restore error. So I'm reverting the change that got Pester from NuGet cache.
2018-02-28 21:08:17 -08:00
Dongbo Wang 25c8fabb44
Remove AppVeyor specific cmdlet from 'Start-NativeExecution' (#6263)
Refreshed the cache by running `dotnet nuget locals all --clear` before `dotnet restore`.
2018-02-28 16:07:26 -08:00
Dongbo Wang 76526c6f1d
Restore modules from the NuGet package cache by using dotnet restore (#6111) 2018-02-27 13:36:54 -08:00
Steve Lee e95f0099ed Fix Start-PSPester to include or exclude 'RequireSudoOnUnix' tag smartly on Unix (#6241)
If `-sudo` is specified, make sure to include 'RequireSudoOnUnix' tag on Unix if the 'Tag' is not specified.
If `-sudo` is not specified, make sure to exclude `RequireSudoOnUnix` tag on Unix if the 'ExcludeTag' is not specified.
2018-02-27 09:23:05 -08:00
Dongbo Wang c4c47476b0 Fix the terse output on Windows for unelevated test run (#6252)
* Fix the terse output on Windows for unelevate test run

* Make the regex pattern more accurate
2018-02-26 16:57:27 -08:00
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
Dongbo Wang 718a6722c9 Fix Linux packages (#4994)
* Build one deb package for each Debian distro
* Build all deb packages with a single run of script
2017-10-03 14:29:43 -07:00
Dongbo Wang fa170a7e00 Suppress the output of building test tools in Compress-TestContent (#4957)
When uploading CodeCoverage artifacts, `Compress-TestContent` is called which calls `Publish-PSTestTools` to build test tools. The build output was captured by `$codeCoverageArtifacts` which causes `Push-AppveyorArtifact` to spit out a lot of errors. The issue is fixed by this change.
2017-10-02 12:14:19 -07:00
Dongbo Wang a4b8dd0a23 Remove Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll (#4868)
The code in `AssemblyLoadContext.dll` doesn't need to be in a separate DLL anymore.
S.M.A.dll depends on `AssemblyLoadContext.dll`, so keeping that code out of S.M.A.dll doesn't help make S.M.A smaller size or less dependent. So the code in `AssemblyLoadContext.dll` is moved to `S.M.A.dll` and then we remove `AssemblyLoadContext.dll`.

The changes are:
- Move `CorePsAssemblyLoadContext.cs` to `src\S.M.A\CoreCLR\`
- Update `CorePsAssemblyLoadContext.cs` to get the test took moved to `Utils.InternalTestHooks` and update tests
- Update `build.psm1` and `.csproj` accrodingly
- Update `pwrshcommon.cpp` to remove `AssemblyLoadContext.dll` from the TPA list.
- `S.M.A.AssemblyExtensions` is removed as `PackageManagement` has finished their move to .NET Core 2.0. (I will work with Bryan to get the latest version uploaded to powershell-core)
2017-09-29 17:26:55 -07:00
Ilya 6e77537181 Get 'PSVersion' and 'GitCommitId' from the 'ProductVersion' attribute of assembly (#4863) 2017-09-28 09:27:43 -07:00
Dongbo Wang bb3a840e76 Create generic Linux-x64 packages that are portable to all supported Linux distros (#4902) 2017-09-25 12:49:43 -07:00
Steve Lee 9791116979 reduce output of pester for CI (#4855) 2017-09-19 14:56:32 -07:00
Dongbo Wang 192803bfcf Build powershell core using the generic RID 'linux-x64' (#4841) 2017-09-18 09:31:07 -07:00