Commit graph

572 commits

Author SHA1 Message Date
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
bergmeister d804d7fd30 Make the build output the WiX compilation log if it failed. (#4831)
* Make the build output the WiX compilation log if it failed.
Before it was not outputting it not at all because the build output is an array that was piped directly to 'Write-Verbose' instead of converting it to a string using 'Out-String'
Because the WiX log is usually quite verbose (around 250 lines), the log is only shown if there must have been a compilation error due to the missing MSI

* PR 4831: Use -Verbose option on Write-Verbose to force output in build as suggested in review.
2017-09-14 14:12:51 -07:00
Travis Plunk ea7c2bddbe Update travis-ci script so that PRs can fail due to pester tests (#4830)
* Add a switch to force tests to fail for testing CI system to Start-PSPester
* [includeFailingTest] Add commit tag to force tests to fail for testing CI system
2017-09-13 14:14:08 -07:00
Steve Lee 3815a95242 validate the expected output package exists (#4795) 2017-09-11 12:36:24 -07:00
Steve Lee 6f1c7a05c6 Enable cross compiling for raspberry-pi arm32 (#4742) 2017-09-11 12:16:58 -07:00
Steve Lee 7c9b188c13 Rename $IsOSX to $IsMacOS (#4757) 2017-09-07 10:34:40 -07:00
Ilya e588a18c76 Refactor MSBuild project files to get PowerShell version from git tag (#4182)
Extract information about the release tag, number of commits since the tag and the hash of the latest commit within a MSBuild target, and bake that information into version properties of the assemblies appropriately.
2017-09-06 15:20:25 -07:00
Mark Kraus 3b2d169c5e Add test WebListener module and tests for Web Cmdlet Certificate Authentication (#4622)
Introduce new test module 'WebListener.psm1'.
Now web HTTPS tests can use it to exclude using external sites.

PowerShell/PowerShell#4609

* [Feature] Add Tests for Web Cmdlet Certificate Authentication

PowerShell/PowerShell#4609

* [feature] Add new app to Publish-PSTestTools refactor tests

also add ASP.NET to .spelling

* [feature] spelling fix

* [feature] revert badssl changes

* [feature] Impliment suggestions

* [feature] Spelling, var rename, port 8443 to 8083

rebase fix conflict

* [feature] Rename to HttpsListener and Module-ize

.

* [feature] password protect ClientCert to fix macOS import issue

* [feature] Rename to WebListener 

* Rename HttpsListener to WebListener
* Switch Listener from Razor pages to MVC
* Address PR feedback
* Adjust tests

* [feature] Address PR feedback

* [feature] Replace missing smeicolons

* [feature] Address PR Feedback

* [feature] Cleanup and minor fix

* Enum was not used
* GetStatus() was not accessing the correct property chain
* Added -Test param to make URL generation smoother in test code and to fix double / issues

* [feature] More minor fixes

* Https when it matters.
* Expand property... not exclude..
* Remove superfluous and outdated ToString() override

* [Feature] Move ClientCeret.pfx to WebListener Module

* Move the cert
* Adjust Get-WebListenerClientCertificate 
* Remove cert from csproj
* ActionResult -> JsonResult (was mistakenly left as ActionResult during testing)..

* [Feature] Move ServerCert.pfx to Module

* Move cert
* Upate csproj
* Update module
* Add/Update README.md's

CI Retest.
2017-08-31 13:30:35 +04:00
Travis Plunk bd42fe95b4 change the default windows RID to win7-<arch> (#4701) 2017-08-29 17:21:50 -07:00
Travis Plunk 6a68838730 For reliability, start using pester PassThru object to verify tests passed (#4644)
* Add ability to verify a test run using the `-passthru` object from pester
* update travis-ci to use `-passthru` object to verify test results
* Address PR feedback
* call show-pspestererror with a named parameter
2017-08-26 08:26:06 -07:00
Steve Lee 1e0acfac5e removed appending WindowsPowerShell PSModulePath (#4656) 2017-08-25 11:05:23 -07:00
Ilya cdbbb7a4bb Minor formatting commits for Build.psm1 and csproj files (#4630) 2017-08-21 15:23:52 -07:00
Dongbo Wang b3e7fd374f Move to the official .NET Core 2.0 (#4603)
* Migrate to official .NET Core 2.0

* [Feature] Remove chmod code as the issue has been fixed in dotnet
2017-08-16 17:32:46 -07:00
Aditya Patwardhan c699e73ebe Fixed typo (#4600) 2017-08-16 16:07:18 -07:00
Dongbo Wang feeb8e1d25 [Feature] Clean up FullCLR related scripts/docs (#4580) 2017-08-16 12:07:45 -07:00
Travis Plunk 0ca44f147d Package only from the powershell folder at the root directory (#4569) 2017-08-15 16:17:45 -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
Mike Richmond 515a999e1c Porting Enable-PSRemoting and its Tests (#2671)
Fixes #1193 for most scenarios. The remaining scenario to be addressed is the Nano Server bring-up scenario. To continue supporting that scenario, I left the Install-PowerShellRemoting script in place.

This change 
1. Ports Enable-PSRemoting and Disable-PSRemoting to PowerShell Core
2. Adds side-by-side PowerShell Core remoting support to the PSSessionConfiguration cmdlets and PSRemoting cmdlets.
3. Ports PSSessionConfiguration tests

This change also introduces a behavioral difference. The PSRemoting and PSSessionConfiguration cmdlets are now context-sensitive and only work for endpoints that match the PowerShell type. For example, Get-PSSessionConfiguration, when running in PowerShell Core, will only return PowerShell Core WinRM endpoints. It will only modify PowerShell Core WinRM endpoints and cannot be used to configure Windows PowerShell endpoints.
2017-08-08 09:36:22 -07:00
Dongbo Wang d2e8d0333d use fpm 1.8.1 (#4468) 2017-08-02 17:09:36 -07:00
Travis Plunk 256ce72ed1 Remove appx packaging related script (#4376) 2017-08-01 17:24:31 -07:00
Travis Plunk e829053e9e Add ability to package all of powershell core as a NuGet Package (#4363)
So that PowerShell can be installed using PackageManagement cmdlets find-package and install-package.
2017-08-01 14:35:50 -07:00
Dongbo Wang b0efc7c2c2 Separate Windows PSRP binary build out of Start-PSBuild (#4335)
There are following major changes:
- `Start-PSBootstrap -BuildWindowsNative` installs the native dependencies required for building PSRP binary. Without `-BuildWindowsNative`, it only installs the dotnet-SDK on Windows platform.
- `Start-PSBuild` doesn't build Windows PSRP binary. Instead, `Start-BuildNativeWindowsBinaries` is added to build it. After the build, 3 files (`'pwrshplugin.dll'`, `'pwrshplugin.pdb'`, `'Install-PowerShellRemoting.ps1'`) will be bin-placed at `src\powershell-win-core` like before.
- The NuGet package `'psrp.windows'` is added to `powershell-core` feed, and we reference it in `powershell-win-core.csproj` to get the Windows PSRP related files. Files (.dll and .pdb) in the package are from the beta.4 release build.
2017-07-25 16:50:27 -07:00
Travis Plunk d24d1634ba Remove unneeded try-catch in build.psm1 (#4328) 2017-07-24 15:26:04 -07:00
Travis Plunk 76e184b0ba move packaging CmdLets to separate module (#4319)
* fix PsScriptAnalyzer issues
* update release docs
2017-07-23 12:29:33 -07:00
bergmeister ffd39b2853 PSScriptAnalyzer fixes by category (#4261)
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'ForEach-Object' (alias is '%' or 'foreach')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Where-Object' (alias is '?' or 'where')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Select-Object' (alias is 'select')
- Fix PSScriptAnalyzer warnings of type PSPossibleIncorrectComparisonWithNull. Essentially, $null has to be on the left-hand side when using it for comparison.
- A Test in ParameterBinding.Tests.ps1 needed adapting as this test used to rely on the wrong null comparison
- Replace a subset of tests of kind '($object -eq $null) | Should Be $true' with '$object | Should Be $null'
2017-07-21 21:03:49 -07:00
James Truher [MSFT] 4df979a475 Create symlinks in publish path for RedHat variants (#4198) 2017-07-20 09:42:34 -07:00
Travis Plunk f1ff79011d Due to the use of unsupported APIs, we must remove the LocalAccounts module until a better solution is found. (#4302) 2017-07-19 17:20:35 -07:00
Steve Lee 76413addac Run CI and Feature tests by default with Start-PSPester (#4273) 2017-07-18 14:20:14 -07:00
Travis Plunk 73b3b0895c Use cached 'dotnet' in AppVeyor (#4278) 2017-07-18 11:39:04 -07:00
Kirk Munro 011271ca25 Add Build Check for MFC for Visual C++ During Windows Builds (#4185)
* added requirement check for atlbase.h

* removed blank line mistakenly added

* updated based on pull request feedback
2017-07-17 11:47:11 -07:00
bergmeister f95fbf144e Checkbox to open PowerShell after the (Windows) installer has finished (#4203)
Added a checkbox (unchecked by default) to the last dialogue of the Windows installer to provide the option of opening PowerShell because that's what most people want to do if they installed PowerShell.
2017-07-14 18:10:35 -07:00
Travis Plunk 6b252868d4 Make travis ci quieter (#4229) 2017-07-11 22:07:31 -07:00
Steve Lee 7bce1653f3 Add Windows PowerShell PSModulePath by default on Windows (#4132)
This change is only for Windows and appends the Windows PowerShell PSModulePath on startup via a default profile. Depending on the data/feedback we get, we can decide what to do (opt-in vs opt-out) as we get closer to a release candidate.
2017-07-07 09:43:37 -07:00
Dongbo Wang 3e35fb9918 Move powershell to 2.0.0-preview3-25426-01 using the .NET CLI 2.0.0-preview2-006502 (#4144) 2017-06-30 13:07:14 -07:00
Ilya 20862d6204 Check the dotnet-cli version in Start-PSBuild (#4045) 2017-06-21 09:32:06 -07:00
Steve Lee a66cd0b620 Remove ClrVersion property from $PSVersionTable (#4027)
* ClrVersion property of $PSVersionTable is not useful with CoreCLR and end users should not be using it
that value to determine compatibility.  Recommendation from dotnet team is to remove that property.

* Removed internal members used for CLRVersion

* removed CLRVersion from FullCLR build as well

* added additional information to run `start-psbootstrap -buildnative` if cmake is not found
2017-06-19 15:10:36 -07:00
Dongbo Wang b4973fc920 Move PowerShell back to .NET Core 2.0.0-preview1-002106-00 (#4026) 2017-06-15 16:29:25 -07:00
Dongbo Wang 8731747c3e Move to latest .NET Core and enable -SkipCertificateCheck on OSX (#3887) 2017-06-13 17:58:20 -07:00
Steve Lee ea0082ab8d Consolidated the two test exes into one (#3982)
Combined the previous echoargs and createchildprocess test exes into a single TestExe that can be extended for other tests.
2017-06-13 17:49:56 -07:00
Aditya Patwardhan 73548532bc Fixed code coverage infrastructure and some failing tests (#3914)
Fixed tests that were failing or throwing unnecessary information on-screen.
Updated the paths to powershell.exe as per the new artifact layout.
Added Publish-PSTestTools to Compress-TestContent
Added PS Test tools to PSModulePath before starting tests.
2017-06-05 17:37:48 -07:00
Sergei Vorobev 924f281c96 Fix Start-PSBuild -SMAOnly with the latest dotnet cli (#3930) 2017-06-05 14:10:42 -07:00
Travis Plunk fc75c16a30 Set default parameter set for Start-PSPackge (#3939) 2017-06-05 13:39:15 -07:00
Dongbo Wang 299a8abb56 Make 'Start-PSBuild' and 'Start-PSPackage' accept a release tag argument (#3921) 2017-06-05 10:21:28 -07:00
James Truher [MSFT] 51d4a45e3c Change package name 'el7.centos' to 'el7' (#3732) 2017-05-30 15:25:07 -07:00
Aditya Patwardhan 7517004052 Fix check for Wix toolset in New-MSIPackage (#3843)
Wix toolset is part of the AppVeyor base image. The daily build did not generate a MSI since Wix toolset was not found.
AppVeyor updated the Wix version in the base image and our checks failed.
The fix removes the hardcoded version from path. It also guards against multiple side-by-side versions.
2017-05-22 22:28:31 -07:00
Steve Lee 96506f4cc1 Cross-gen the top assemblies with JIT times > 5ms (#3787)
Startup went from 1998 ms to 1067 ms.
Size went from 103 MB to 133 MB.
2017-05-15 23:34:32 -07:00
Dongbo Wang ee779b58e0 Update docs for beta.1 release (#3748)
* First iteration

* Second iteration

* Third iteration

* Fourth iteration

* Fifth iteration

* Revert the temporary workaround

* beta.1 release only support Mac OSX 10.12+
2017-05-10 09:49:02 -07:00
Dongbo Wang c8a9284731 Temporary workaround #2 to fix the PSVersion issue in beta.1 release (#3742) 2017-05-09 00:21:28 -07:00
Dongbo Wang 44c6409fdd Temporary workaround to fix the PSVersion issue in beta.1 release (#3740) 2017-05-08 22:52:30 -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 73e5dc3020 Make sure nuget package version suffix applies to all ProjectReference (#3678) 2017-05-01 22:34:25 -07:00
James Truher [MSFT] a2268ab3ec Add telemetry to the console host to report platform and version (#3620)
This is limited to the console host and is not meant as generalized telemetry code for PowerShell Core. It will capture the GitCommitID and Platform Information when the console host starts. It enables opting out of sending telemetry.
2017-04-25 22:51:22 -07:00
Dongbo Wang 1c1c75318e Add 'x' permission to crossgen on Linux and OSX (#3592) 2017-04-18 16:51:18 -07:00
Dongbo Wang 79a1f80309 Update build script to always use 'dotnet publish' (#3589)
Also update 2 building docs
2017-04-18 13:12:35 -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
Raghu Shantha [MSFT] d2d80c6832 Use Product Semantic version in the MSI installer where possible (#3435) 2017-03-29 13:36:44 -07:00
Ilya 27b27cc43a Autoload TestRemoting.psm1 (#3430) 2017-03-29 10:11:02 -07:00
Dongbo Wang 5c6ca49da4 Rename OSX package name to include operating system information (#3440) 2017-03-27 18:27:07 -07:00
Travis Plunk 737058f62e Add markdown lint test (#3420)
* Fix markdown syntax and spelling issues
* update spelling dictionary
2017-03-27 16:44:28 -07:00
Steve Lee c0c4cf41e7 rename AppImage to include version (#3433) 2017-03-27 15:52:58 -07:00
Ilya a99fb531e6 Add autoload for test modules (#3342)
Related #3238

1. Add autoload for test modules
2. Move TestHostCS.psm1 to 'test\tools\Modules\' folder
3. Remove explicit load TestHostCS.psm1 from test files
2017-03-26 21:46:39 -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
Travis Plunk 27c819ce2e Add build support for OpenSUSE 42.1 (#3389) 2017-03-22 14:19:51 -07:00
Sergei Vorobev 1225977f14 Restore Microsoft.PowerShell.Archive module from www.powershellgallery.com 2017-03-22 12:43:38 -07:00
Steve Lee 76de340e79 corrected use of PSModulePath casing to be consistent with Windows PowerShell (#3255)
* corrected use of PSModulePath casing to be consistent with Windows PowerShell
addresses #3227

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in
2017-03-15 12:04:28 -07:00
Travis Plunk 0fc4ef4c2e Add support for crossgen on OpenSUSE 13.2 (#3326) 2017-03-14 11:44:29 -07:00
Dongbo Wang dd0fbd63a1 Fix $LinuxInfo to be a Hashtable instead of an array of Hashtable's. (#3276)
Get-Content /etc/os-release returns an array of strings, which get feeded to ConvertFrom-StringData. Therefore, $LinuxInfo is actually an array of Hashtable instances before this change. Property access on $LinuxInfo like $LinuxInfo.ID happens to work because powershell supports accessing a property or calling a method on a collection of object, but it's inefficient.
After this fix, $LinuxInfo will be a Hashtable, and it's efficient to access its members.
2017-03-07 16:23:18 -08:00
Travis Plunk 5d97bc558a update build.psm1 to support packaging for opensuse 13.2 (#3274) 2017-03-07 15:03:38 -08:00
Travis Plunk e734d44199 Add OpenSUSE 13.2 build support (#3254) 2017-03-06 17:30:14 -08:00
Kevin Marquette f29b99ec6a Add PassThru support to Start-PSPester (#3205) 2017-03-06 13:13:34 -08:00
Andrew Schwartzmeyer 8185fd9350 Add AppImage to CI 2017-02-17 11:09:36 -08:00
Francisco Gamino f852e40b3c Enabling crossgen for the assemblies used by Add-Type, which are Microsoft.CodeAnalysis.CSharp.dll, Microsoft.CodeAnalysis.dll, Microsoft.CodeAnalysis.VisualBasic.dll, and Microsoft.CSharp.dll. This speeds up executing Add-Type from ~3 to 0.9 seconds. (#3086) 2017-02-03 15:19:05 -08:00
Sergei Vorobev b37371b3dd Fix patching logic for .dotnet openssl dylib
Fixes #3062
2017-02-03 09:27:35 -08:00
Sergei Vorobev 9750297ce3 Add 'osx.10.12-x64' runtime to project.json files 2017-02-01 17:52:35 -08:00
Mike Richmond 1431105251 Adding Microsoft.PowerShell.Commands.Diagnostics to the list of packages published to our MyGet feed (#3050) 2017-01-30 16:44:23 -08:00
Joey Aiello f41b94fe03 change '2k' years in build script (#3043) 2017-01-25 18:00:39 -08:00
Andrew Schwartzmeyer 3a34747913 Address code review issues 2017-01-20 11:05:24 -08:00
Andrew Schwartzmeyer f1767dd24d Fix undefined variable in build.psm1
`$rpm_dist` used to be unconditionally defined,
but the changes to support Fedora made it defined only on
RedHat family platforms, so the variable was undefined on Ubuntu
but the flag still added to fpm's arguments, causing a build error.
Now we only add the flag and its argument when it's relevant.
2017-01-20 11:05:24 -08:00
Naadir Jeewa 01dfb88e4d Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-20 11:05:24 -08:00
Jason Shirk 8c08c7b382 use global nuget package cache (#2987) 2017-01-17 13:00:52 -08:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Paul Allen c43de5a19f Add dependent symlinks in package for libmi.so 2017-01-10 17:44:04 -08:00
James Truher [MSFT] c97ca777df Jameswtruher/travisdailybuild (#2958)
* Stifle progress output in build.psm1 for some operations

Modify test failure presentation to use platform available XML methods

* Add timeout support for returning runtime parsing errors

Some of the language/parser tests have been hanging in a non-reproducable manner which
causes the CI system to invalidate the entire run. This change adds support for timeout
which will fail a test if it runs to long, rather than invalidate the entire run.

current behavior is still supported, and is not done in a new session:
PS> get-runtimeerror -src '1/'
At line:1 char:3
+ 1/
+   ~
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

Adding a timeout will do the operation in a async powershell session
PS> get-runtimeerror -src '1/' -timeout 5
You must provide a value expression following the '/' operator.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression

If the operation takes longer than the supplied timeout, a timeout error will be returned
PS> get-runtimeerror -src 'start-sleep 6' -timeout 2
get-runtimeerror : Operation Timed Out ('start-sleep 6')
At line:1 char:1
+ get-runtimeerror -src 'start-sleep 6' -timeout 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RuntimeError

* Modify native linux command tests to skip on Windows and pending on Mac

* remove verbose and progress output from help tests

* Be sure that Feature Counter tests only run on Windows

Also, only call add-type in CounterTestHelperFunctions.ps1 if we're going to actually run the tests

* do not run any get-computerinfo tests on non-windows systems

* suppress progress output from PowerShell Get tests

* remove -quiet from API and CRON Builds

Travis watches output from the build to ensure that it hasn't hung
we need to find a balance between too much output and not enough output.
A run which has too much output is killed because it looks like an error loop
A run which has too little output is killed because it looks like a hang

* Remove commented line in Import-Counter.Tests.ps1

Remove extraneous extra line in PowerShellGet.Tests.ps1

* Change `-as "type"` to `-as [type]` in build.psm1

Alter timeout to 10 seconds to be improve chances of not timing out for runtime parser checks
improve logic for counter tests to also skip for IoT

* use the existing function of SkipCounterTests rather than duplicate the logic in import-counter.tests.ps1
2017-01-10 14:42:27 -08:00
Mike Richmond 4eb1494442 Revert "Initial Support for Fedora 24" (#2970) 2017-01-06 13:09:40 -08:00
Naadir Jeewa 8262091b3a Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-06 10:04:18 -08:00
Manikyam Bavandla 3938cdb33a [Build] Update the logic to remove PSGetModuleInfo.xml from PowerShellGet module on Non-Windows platforms. (#2897) 2016-12-16 22:16:03 -08:00
Hemant Mahawar e26c2a8752 Adding windows server names to the windows packages + Misc formatting fixes (#2757)
* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Adding windows server names to the windows packages + Misc formatting fix

Misc fixes are:
- Added Get-PackageSemanticVersion function
- Added New-ZipPackage function to separate the Zip packaging code
- Removed ending ';' in hashtable syntax since entries are on new lines
- Standardized the variable name from $Source to $PackageSourcePath for
various packaging functions
- Removed 'return' in the function end to output the variable value
- Added -verbose to Write-Verbose to show the paths of various packages

* update

* Addressing review feedback

* Removed the $PackageVersion variable per review feedback

* Error message fix
2016-12-14 09:28:38 -08:00
Sergei Vorobev cb378be1c8 Create Start-PSRelease helper function (#2753) 2016-12-12 09:34:17 -08:00
Naadir Jeewa 32a8601f92 Rebase onto .NET Core 1.1 (#2737)
* Rebase onto .NET Core 1.1

Modify `Build.psm1` and `project.json` files to use .NET Core 1.1.

.NET Core 1.1 ships with an older dotnet/cli than has currently been used,
so we revert to use case-sensitive directory names for dependencies.

.NET Core 1.1 is a pre-requisite for supporting Fedora 24.

* PSReadLine: Bump major version of PSReadline to 6.0.0-*

* Microsoft.PowerShell.Commands.Utility: Bump major version of Microsoft.CodeAnalysis.Csharp

* Microsoft.PowerShell.SDK: Revert attempt to import netcoreapp1.1 instead of dnxcore

* build.psm1: Restore ability to specify version of dotnet-install.sh
2016-12-07 18:29:21 -08:00
James Truher [MSFT] 8e360bffb1 modify Start-PSPester to accept -Quiet to eliminate Pester output (#2795)
* modify Start-PSPester to accept -Quiet to eliminate Pester output

also modify travis.ps1 to include -Quiet for Pester args to reduce
stdout log size which should hopefully allow daily builds to run
without being cancelled due to too much output

* Add error detail information as part of Test-PSPesterResults

Test-PSPesterResults will now also emit information about the errors
found during a test run rather than just the number of failed tests.
Created a new errorlog function so the output of errors will be red.
2016-12-01 11:23:14 -08:00
Manikyam Bavandla 67e9bf6376 - Fixed failing PackageManagement related tests in daily-builds (#2759)
- Updated Restore-PSModule function to delete the PSGetModuleInfo.xml so that this file will not be included in the PowerShell release.
- Since PackageManagement module gets installed with PowerShellGet module, removed PackageManagement module name in Restore-PSModule command invocation.
2016-11-21 17:36:51 -08:00
Mike Richmond cac96e5fc9 Fixing powershell.exe lib paths and more thoroughly cleaning the powershell-native directory (#2758) 2016-11-21 16:55:03 -08:00
Mike Richmond bfd6d65458 Add x86 CrossGen support (#2726) 2016-11-20 12:59:50 -08:00
Sergei Vorobev 471594c6ab Make Start-PSBootstrap on macOS better
No errors if brew dependencies already present
2016-11-19 23:52:16 -08:00
Sergei Vorobev 5ff63e50b7 Make Restore-PSModule -Name parameter a [string[]] 2016-11-19 23:52:16 -08:00
Jianyun Tao 1fff6760b6 Removed PowerShellGet source and replaced with ones from myget 2016-11-19 23:52:16 -08:00
Jianyun Tao 9b27d4a23a add psmodulerestore in travis.ps1 2016-11-19 23:52:16 -08:00
Jianyun Tao bfe59b3495 # This is a combination of 3 commits.
# The first commit's message is:

Changed to PSModuleRestore switch, i.e., by default no PSModule install

# This is the commit message #2:

install PowerShell modules to publish folder as well as one level up

# This is the commit message #3:

removed workaround
2016-11-19 23:52:16 -08:00
Jianyun Tao 535f977d1a Update build.psm1 to pull PackageManagement assemblies 2016-11-19 23:52:16 -08:00
Mike Richmond c9fb03edf2 Add x86 support to the MSI installer 2016-11-18 16:35:16 -08:00
Mike Richmond e23b0b2002 Add runtime win7-x86 2016-11-18 16:35:16 -08:00