Commit graph

572 commits

Author SHA1 Message Date
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
Mike Richmond 81b2339979 Add support to build x86 packages for PowerShell Core 2016-11-18 16:35:16 -08:00
Sergei Vorobev dbc084537a Remove default value for version from Install-Dotnet, so it's controlled only in Start-PSBootstrap 2016-11-14 11:27:38 -08:00
Sergei Vorobev f5ca586118 Temporarely pin dotnet obtain script url 2016-11-14 11:27:38 -08:00
Dongbo Wang dad2c7d155 Update releasing doc to include steps to create Linux/macOS packages and NuGet packages (#2663)
* Update releasing.md with package creation steps for Linux and macOS

* Add documentation for creating NuGet Packages

* Minor fixes
2016-11-11 17:13:04 -08:00
Aditya Patwardhan b18adb85d4 Add OpenCover PS Module to collect code coverage (#2585)
* Add OpenCover PS Module to collect code coverage

OpenCover PS Module helps is collecting Code Coverage using the OpenCover
toolset. The module helps in comparing two code coverage runs as well.

* Change OpenCover.psd1 to ASCII

* Fix an error in path for OpenCover

Fixed an error on path for OpenCover. Also used ZipFile class instead of
cmdlet as it might not be available on CI system.

* Convert module to be Powershell v4 compliant

Changed implementation from classes to PSObjects and implemented
Expand-ZipArchive.

* Added CodeCoverage as a configuration to project.json files

Added CodeCoverage as the new configuration for all the project.json
files. When Start-PSBuild is executed with configuration as CodeCoverage,
we change the degubType to 'full' as required by OpenCover toolset.

Also made changes to appveyor.psm1 to build a CodeCoverage package on
daily builds and publish it as a zip.

* Addressed code review comments

Changed from Add-Member to use pscustomobject type accelator. Removed
[gc]::collect.

* Added explicit garbage collection

* Addressed code review comments

- Make sure that the build Start-PSPackage gets is not a code coverage
  build
- Add debugType = full for FullCLR
- Remove configurations from PackageManagement files as it is not needed.
- Build CodeCoverage build first in AppVeyor.

* Resolve merge conflict

* Fix indentation

* Fix newline at end of file

* Added command discovery for locating OpenCover.console.exe
2016-11-11 11:12:07 -08:00
Hemant Mahawar f315647214 Use the unabbreviated parameter names in Start-PSBootstrap (#2623) 2016-11-04 13:17:30 -07:00
Sergei Vorobev a3afeee54e Fix Start-PSBootstrap install_name_tool call on macOS (#2601) 2016-11-03 14:30:11 -07:00
Sergei Vorobev 46ff660271 Fix crypto libs patching logic to accomodate multiply files (#2541)
Native library also changed from System.Security.Cryptography.Native.dylib
to System.Security.Cryptography.Native.OpenSsl.dylib

See discussion in #2510
2016-11-02 14:25:46 -07:00
Sergei Vorobev 2f233644f2 Pin dotnet-cli version to 1.0.0-preview3-003930 (#2573) 2016-10-31 17:55:29 -07:00
Mike Richmond 9b478dd531 Fixing the Win10 sdk presence check (#2568) 2016-10-31 15:02:44 -07:00
Steve Lee 44eb20dc8f Fixes #2534 by replacing expensive WMI query with Win32 API calls (#2535)
* Fixes #2534 by replacing expensive WMI query with Win32 API calls

* fix break on unix build

* added tests for #2535

* although test passed, fixing exception that shows up

* fixed Describe text

* addressing code review feedback

* addressing review feedback to comment on why sleep is needed
added check that test processes are created before we try to kill them

* fixed test to timeout and pending fix for #2561
2016-10-31 09:41:13 -07:00
Sergei Vorobev 5c6a11213b Wrap calls to choco install in Start-NativeExecution (#2547) 2016-10-27 13:06:17 -07:00
Dongbo Wang 1d29d42ff7 Remove crossgen'ed IL assemblies and then rename NI assemblies to the same as the corresponding IL images. (#2484)
* Remove crossgen'ed IL assemblies and then rename NI assemblies to the same as the corresponding IL images.
This is to make sure:
  1. The dependency existence check by powershell.exe will pass for all TPAs.
  2. CoreCLR by default will load the NI images even though it's using names of the IL images.

* Update the comment to make it easy to understand
2016-10-18 13:12:51 -07:00
Dongbo Wang a1aac43f1b Update build.psm1 to not remove IL assemblies after crossgen because the latest dotnet.exe checks the existence of all TPA assemblies, including those built from the local projects 2016-10-14 10:02:44 -07:00
Dongbo Wang 2e402cfef1 Update powershell to depend on latest dotnet core packages (preview1-24530-04 from 9/30/2016) 2016-10-14 10:02:44 -07:00
Andrew Schwartzmeyer f62dd4bf54 Allow Start-PSBuild -Output to take absolute path (#2398)
There was no point to using Join-Path here,
but it made it impossible to specify absolute paths
(or any path outside of the PowerShell repo).
2016-10-03 11:04:40 -07:00
Mike Richmond 374e1d1b21 Merge pull request #2280 from vors/admin-tests
Separate tests on Windows CI to Admin-Required and Non-Admin-Required
2016-09-29 16:28:29 -07:00
Aditya Patwardhan f31d4a5ac2 Add archive with test content to AppVeyor artifacts for daily builds.
The change adds Compress-TestContent cmdlet to build.psm1 so that it can
compress the powershell test content. This is done only for daily builds.
2016-09-29 12:38:12 -07:00
Sergei Vorobev 5fe1c431fa Make Get-PesterTag allow only one scope tag (CI, Feature, Priority) 2016-09-29 12:29:27 -07:00
Sergei Vorobev 917bf5abc9 Fix bug about Admin tests defaults Start-PSPester in build.psm1 2016-09-29 12:29:27 -07:00
Sergei Vorobev 911c7d9976 Replace Transcription by *> redirection
due to the issue https://github.com/PowerShell/PowerShell/issues/2334
2016-09-29 12:29:27 -07:00
Sergei Vorobev d1d82d03b4 Make Invoke-AppVeyorTest run elevated and non-elevated tests separately
- Add RequireAdminOnWindows to the list of blessed tags
- Fix a bug in Get-PesterTag where we accepted 'Slow' as a proper priority
- Fix missed comma in Start-PSPester parameters
- Add documentation about new Pester tag
- Fix finishing logic for Start-PSPester -Unelevate
2016-09-29 12:29:27 -07:00
Sergei Vorobev 339c7d80e4 Add Start-PSPester -Unelevated
That will enable running tests without Admin in CI
2016-09-29 12:29:27 -07:00
Dongbo Wang 18f732f1e0 Improve Start-PSPackage to support zip package, downlevel packages for win-plat. Fix the version issue and package name for creating msi and appx (#2361)
* Improve Start-PSPackage to support zip package, downlevel packages for win-plat. Fix the version issue and package name for creating msi and appx

* Address comments about New-PSOptions

* Update Start-PSPackage to not show the warning from New-PSOptions
2016-09-28 10:47:16 -07:00
Andrew Schwartzmeyer 8a24d26e8d Patch System.Net.Http.Native.dylib
Again, .NET Core expects users to forcibly link the third party OpenSSL
libraries into system directories, which the Homebrew team advises
strongly against (and attempts to prevent). This also affects the
System.Net.Http library, and results in runtime errors during SSL
certificate validation. So instead, we patch what we can, when we can.
2016-09-20 14:34:32 -07:00
Andrew Schwartzmeyer 5439d50710 Add all dependencies to New-UnixPackage
Now that I finally have a decent list of dependencies (though it may
still be too many), I have expanded the dependencies of the package so
that users get better error messages.

I've removed ca-certificates as that's not *necessarily* required (but
needed on Docker to download over HTTPS). This may be true of other
packages too.
2016-09-20 13:57:36 -07:00
Douglas Thrift 4d5d0a0034 Rename Publish-EchoArgs to Publish-PSTestTools
* Rename Publish-EchoArgs to Publish-PSTestTools so it can be used
  for other tools as well in the future
* Publish EchoArgs to the bin directory instead of run to match
  convention
* Add source URL to EchoArgs header comment
* Use wildcard of "*.nuget.props" to match
  "test/csharp/csharp.nuget.props" in .gitignore
2016-09-13 13:37:42 -07:00
Douglas Thrift 7e8070276f Move and "publish" EchoArgs for the tests
* Move EchoArgs from test/EchoArgs to test/tools/EchoArgs
* Use "dotnet publish" for building EchoArgs in build.psm1 so the test
  can call it directly
2016-09-13 13:37:42 -07:00
Andrew Schwartzmeyer e1e014295b Add -powershell and -Pester options to Start-PSPester
When testing containers, we want to use the in-box PowerShell.
2016-09-12 15:01:19 -07:00
Andrew Schwartzmeyer 427435c8fd Refactor .NET CLI installation into Install-Dotnet
So that it can be reinstalled separately if desired.

Also removed the set validation as it was now wrong,
and removed the warning about no Invoke-WebRequest on Core PowerShell
(it is ported now).

I don't like the duplicate parameter logic,
especially around -NoSudo.
2016-09-12 15:01:18 -07:00
Andrew Schwartzmeyer fc2c1b9f7d Update apt-get repo in Start-PSBootstrap
yum does not need this as yum install does it automatically.

This is needed when running, for example, in a container.
2016-09-12 15:01:18 -07:00
Andrew Schwartzmeyer 3a66c04f23 Add -NoSudo option to Start-PSBootstrap 2016-09-12 15:01:18 -07:00
Andrew Schwartzmeyer 3687692802 Guard fatal bootstrap steps with Start-NativeExecution 2016-09-12 15:01:18 -07:00
Andrew Schwartzmeyer bb476d4aef Install groff when bootstrapping for packaging 2016-09-12 15:01:18 -07:00
coderdad c531098f3b Working directory fix for googletest submodule update (#2151)
* Working directory fix for submodule update

The git submodule update for googletest must be run from the script's root directory

* Added try-finally block around Push-Location

Great recommendation from @vors! 

The edit is a best practice incase the user Ctrl-C's out of the script. 

Tested locally by exiting out of: 
try { Push-Location C:\Users\; Start-Sleep -Seconds 60 } finally { Pop-Location }
2016-08-31 19:42:27 -07:00
Keith Mosher 77a37f7773 Add powershell to /etc/shells (#1939)
Manages /etc/shells with after (un)install scripts for CentOS and Ubuntu

Fixes #1913
2016-08-31 13:16:11 -07:00
Travis Plunk 55f78781e9 Add message to make it clear what tests are running 2016-08-31 12:17:19 -07:00
Travis Plunk 6f1d1877de Address comments
Made AppVeyor and TravisCI use similar code
2016-08-30 11:47:40 -07:00
Travis Plunk 414cbe77a1 redirect mc error messages to stdout 2016-08-29 19:50:44 -07:00
Dongbo Wang 52e274f644 Publish nuget packages for 'Microsoft.WSMan.Management' and 'Microsoft.WSMan.Runtime' (#2119) 2016-08-29 19:01:38 -04:00
Josh Soref eb3fd7ae6c Spelling comments (#2066)
* spelling: comments in src/Microsoft.Management.Infrastructure.CimCmdlets

* spelling: comments in src/Microsoft.PackageManagement.ArchiverProviders

* spelling: comments in src/Microsoft.PackageManagement.CoreProviders

* spelling: comments in src/Microsoft.PackageManagement.MetaProvider.PowerShell

* spelling: comments in src/Microsoft.PackageManagement.MsiProvider

* spelling: comments in src/Microsoft.PackageManagement.MsuProvider

* spelling: comments in src/Microsoft.PackageManagement.NuGetProvider

* spelling: comments in src/Microsoft.PackageManagement.PackageSourceListProvider

* spelling: comments in src/Microsoft.PackageManagement

* spelling: comments in src/Microsoft.PowerShell.Activities

* spelling: comments in src/Microsoft.PowerShell.Commands.Diagnostics

* spelling: comments in src/Microsoft.PowerShell.Commands.Management

* spelling: comments in src/Microsoft.PowerShell.Commands.Utility

* spelling: comments in src/Microsoft.PowerShell.ConsoleHost

* spelling: comments in src/Microsoft.PowerShell.Core.Activities

* spelling: comments in src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext

* spelling: comments in src/Microsoft.PowerShell.CoreCLR.Eventing

* spelling: comments in src/Microsoft.PowerShell.Diagnostics.Activities

* spelling: comments in src/Microsoft.PowerShell.GraphicalHost

* spelling: comments in src/Microsoft.PowerShell.LocalAccounts

* spelling: comments in src/Microsoft.PowerShell.Management.Activities

* spelling: comments in src/Microsoft.PowerShell.PSReadLine

* spelling: comments in src/Microsoft.PowerShell.PackageManagement

* spelling: comments in src/Microsoft.PowerShell.ScheduledJob

* spelling: comments in src/Microsoft.PowerShell.Security.Activities

* spelling: comments in src/Microsoft.PowerShell.Security

* spelling: comments in src/Microsoft.PowerShell.Utility.Activities

* spelling: comments in src/Microsoft.PowerShell.Workflow.ServiceCore

* spelling: comments in src/Microsoft.WSMan.Management.Activities

* spelling: comments in src/Modules

* spelling: comments in src/Schemas

* spelling: comments in src/libpsl-native

* spelling: comments in src/powershell-native

* spelling: comments in build.psm1

* spelling: comments in src/System.Management.Automation/CoreCLR

* spelling: comments in src/System.Management.Automation/DscSupport

* spelling: comments in src/System.Management.Automation/cimSupport

* spelling: comments in src/System.Management.Automation/commands

* spelling: comments in src/System.Management.Automation/engine/Modules
2016-08-26 13:46:03 -07:00
Adam Driscoll 998b458ac4 Changing the PATH for cmake. 2016-08-25 10:47:52 -05:00
Mike Richmond 02da250fc8 Revert "Pester tests wouldn't run from build directory with spaces" 2016-08-22 16:41:27 -07:00
Barry Nolte d3538851c6 Pester tests won't run from directory with space (#1951)
Added quotes around file/pathnames as needed to get pester tests to run from build directory with a space in it.
2016-08-22 10:56:03 -07:00
Barry Nolte 890e80dd54 Getting tests to run from build directory with spaces in it (#1981)
* [build.psm1] - mc.exe input file needs quotes

For filenames that have spaces or paths to that file that have spaces, the input filename needs to have quotes around it.

* Quoted more paths so tests run from directories with spaces

Found a few locations where paths weren't qutoed or escaped with '& ...' that are needed to get tests to run from build directories with spaces in them.
2016-08-22 09:57:30 -04:00
Barry Nolte dfae53d70d [build.psm1] - mc.exe input file needs quotes (#1943)
For filenames that have spaces or paths to that file that have spaces, the input filename needs to have quotes around it.
2016-08-19 10:53:49 -07:00
Keith Mosher b60160977a Explicitly install 'which' on CentOS
which isn't on CentOS by default and is needed by the dotnet install scripts
2016-08-18 23:31:47 -07:00
Keith Mosher b777d9ef2b Fix the rpm-build package name
The binary is rpmbuild, but the package that provides it is hyphenated.
2016-08-18 23:30:36 -07:00
Matt Wrock 33fcdf37e5 update googletet submodule in bootstrap on linux and osx (#1805) 2016-08-18 08:44:37 -07:00
Karol Kaczmarek 71ae1a69f7 Installing cmake instead of cmake.portable (#1840) 2016-08-17 21:13:52 -07:00
Matt Wrock 4e228e6b02 better win 10 sdk folder to test (#1796) 2016-08-17 15:08:37 -07:00
Jason Shirk 8b056776c0 Stop using 'Open PowerShell' and OPS in code (#1838) 2016-08-16 17:03:34 -07:00
Andrew Schwartzmeyer a9e809c18a Fix naming of Unix packages
- .NET Core RID suffixes removed
- `el7.centos` suffix added to RPM
- `1ubuntu1.14.04.1` iteration used for DEB packages

`~` cannot be used after `ubuntu1` because GitHub release renames it to
a `.`; additionally, no packages lack the final suffix `.1`. While my
machine is `.5` I could find no packages that went past `.3`, so let's
use this to indicate that it works for `14.04.1` and forward.

We are *not* recreating the alpha.9 packages, but will we rename them
accordingly. This means that the filenames will be "correct" but the
meta-data will be out-of-date.
2016-08-16 16:07:54 -07:00
Matt Wrock ff5060b449 provide a more actionable message when vcvarsall.bat is missing 2016-08-14 11:30:54 -07:00
Andrew Schwartzmeyer 3f9b1833ac Fix Start-PSPackage for Release build on Windows 2016-08-11 17:38:45 -07:00
Andrew Schwartzmeyer 349491be84 Support building Ubuntu 16.04 packages 2016-08-11 13:42:02 -07:00
Andrew Schwartzmeyer 39184852d9 Add logic to rename package with runtime suffixed 2016-08-11 13:38:54 -07:00
Andrew Schwartzmeyer 49d297c410 Fix permissions of package files
The DLLs should not be marked executable on Unix.

Also remove deb-build-depends as the `dotnet` package is not yet
universally available.
2016-08-11 13:38:54 -07:00
Andrew Schwartzmeyer c0aac111d3 Enable side-by-side Unix packages 2016-08-11 13:38:54 -07:00
Andrew Schwartzmeyer 5235fed2c7 Refactor Start-PSPackage
Moved Unix package code into New-UnixPackage, switching on $Types to
call the appropriate function given the list of types.

Also fixed bug with chmod on a symlink; it was unnecessary.
2016-08-11 13:38:54 -07:00
Andrew Schwartzmeyer a3f3734f09 Include license during build
Rather than including it only at packaging, we should include this
license as part of `dotnet build` and `dotnet publish`.
2016-08-11 13:38:54 -07:00
Alex Jordan f78ed27597 Adding man page for linux 2016-08-10 14:37:44 -07:00
Andy Schwartzmeyer 800382f019 Merge pull request #1698 from PowerShell/raghushantha-packagemetadatabranch
Updated *nix package metadata fields: Issue #1422
2016-08-10 11:50:12 -07:00
Andrew Schwartzmeyer 0fc21db411 Fix Start-PSPester setup
Start-PSPester must ensure that the environment variable `PSMODULEPATH`
is not set before starting the new PowerShell process.
If it is set, then the tests are not guaranteed to be correct,
as they will be operating with the host process's `PSMODULEPATH`,
thus ignoring their own modules.

I also refactored the Start-PSPester command setup code.
2016-08-09 12:03:30 -07:00
Raghu Shantha [MSFT] 013580e7c1 Updated *nix package metadata fields: Issue #1422 2016-08-09 10:58:22 -07:00
Mike Richmond 73ea16f23c Adding WinRM registration script and pwrshplugin publishing. 2016-08-08 09:38:43 -07:00
Mike Richmond 2a8c04d6b0 Separated Windows binary build by CLR 2016-08-08 09:38:43 -07:00
Andy Schwartzmeyer 0c7573a71a Merge pull request #1638 from PowerShell/frangom/bugfixes
Fixing path to remove ILs after the ngen binary is generated. This fixes issue ##1636
2016-08-05 13:59:13 -07:00
Francisco Gamino d82bbeca76 Fixing write-verbose call to let the user have control over it when calling the function 2016-08-05 13:30:04 -07:00
Andrew Schwartzmeyer 09e1683098 Add Ubuntu 16.04 RID 2016-08-05 10:09:40 -07:00
Mike Richmond a7f5d28f5f Fixing Start-PSPester for non-Windows environments. 2016-08-04 16:46:44 -07:00
Jason Shirk 5676a44f38 Merge pull request #1650 from PowerShell/raghushantha-msieulabranch
EULA for MSI Installer
2016-08-04 15:47:03 -07:00
Francisco Gamino 20ce3cca2b Fixing path to remove ILs after the ngen binary is generated. 2016-08-04 15:33:57 -07:00
Andrew Schwartzmeyer 3143ccf97c Use default Ruby on OS X 2016-08-04 13:52:30 -07:00
Raghu Shantha [MSFT] b6b95c4d63 EULA for MSI Installer 2016-08-04 13:30:00 -07:00
Mike Richmond 419db0e832 Removing dependency on JSON .Net for FullClr 2016-08-04 13:15:34 -07:00
Mike Richmond 33c1f2db23 Fixing execution policy so test automation works 2016-08-04 13:15:34 -07:00
Mike Richmond f8b9b88986 Bug fixes and cleanup in preparation for push. 2016-08-04 13:15:34 -07:00
Andrew Schwartzmeyer 39faa3dd25 Fix OS X OpenSSL link for .NET Core
Due to https://github.com/Homebrew/brew/pull/597,
.NET Core's installation instructions of `brew link --force openssl` are
now invalid (for good reasons, due to security holes). Until .NET Core
updates their libraries to find the OpenSSL libraries correctly, we can
update them as part of `Start-PSBootstrap`.

See https://github.com/dotnet/cli/issues/3964
2016-08-04 11:21:48 -07:00
Andrew Schwartzmeyer f866f8b06f Fix inconsistent braces and whitespace in build.psm1 2016-08-03 13:36:13 -07:00
Andrew Schwartzmeyer c35c9e5ef2 Fix libclrjit name for OS X
It's a dylib, not a so.
2016-08-03 13:36:13 -07:00
Andrew Schwartzmeyer 9c205c6158 Fix crossgen search for Ubuntu/CentOS 2016-08-03 13:13:14 -07:00
Francisco Gamino c16209e39d Enable crossgen on CI 2016-08-03 13:12:51 -07:00
Francisco Gamino 58e7f480c4 Addressing code review comments 2016-08-03 13:12:22 -07:00
Francisco Gamino 733c9f0ab9 Enable crossgen for PowerShell assemblies on Linux 2016-08-03 13:12:16 -07:00
Francisco Gamino 92a37b4675 Enable crossgen for PowerShell binaries on Windows 2016-08-03 10:48:27 -07:00
Alex Jordan b1ea06aaef Merge pull request #1593 from PowerShell/ealexjordan/pscolors
Ealexjordan/pscolors
2016-08-03 10:37:20 -07:00
Sergei Vorobev 08fda6842a Replace powershell-based resgen by dotnet C# based one 2016-08-02 11:47:53 -07:00
Alex Jordan e2846379b8 Fixing default and error colors for PSReadLine 2016-08-02 00:16:54 -07:00
Sergei Vorobev aa0a00b6fb Fix Start-DevPowerShell to use upercase for PSMODULEPATH (unix) 2016-07-28 11:47:36 -07:00
James Truher [MSFT] 3ecac72baf Merge pull request #1526 from PowerShell/jameswtruher/TagPesterTests
Jameswtruher/tag pester tests
2016-07-27 14:39:32 -07:00
Sergei Vorobev ce5cc3ca37 Fix Start-DevPowerShell for PowerShellCore edition on windows 2016-07-27 12:27:41 -07:00
James Truher 5e61213be9 update appveyor.yml to check for bad test tags
add the function to check tags to build.psm1
rename the parser tests so they actually execute
2016-07-27 12:06:51 -07:00
James Truher 19e1cc450b final changes for start-pspester 2016-07-27 12:06:51 -07:00
James Truher a784149b36 all tests are now marked with proper tag
also, update build.psm1 to be more flexible
2016-07-27 12:06:51 -07:00
James Truher 362a807438 Add changes to build.psm1 to run only CI tests 2016-07-27 12:06:51 -07:00
Sergei Vorobev 2fe4764830 Fix Start-DevPowerShell for Unix 2016-07-27 10:55:42 -07:00
Sergei Vorobev 99e4b87cc6 Teach Start-DevPowerShell run CoreCLR version 2016-07-27 10:49:46 -07:00
Andy Schwartzmeyer 1349372b39 Merge pull request #1538 from PowerShell/vors/sma-only
Make Start-PSBuild -SMAOnly Unix-friendly
2016-07-27 10:29:16 -07:00
KarolKaczmarek 2405c65113 Merge pull request #1464 from PowerShell/kkaczma/mc
Fixing mc.exe detection and installing required tools in Start-PSBootstrap. Fixes #1451
2016-07-27 10:18:52 -07:00