From 313827e29fc4eb569ed64ac707032caae22508f3 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Wed, 8 Jan 2020 09:59:07 -0800 Subject: [PATCH 1/8] added [wip] Whats new PowerShell 7.0 --- .../whats-new/What-s-New-in-PowerShell-70.md | 448 ++++++++++++++++++ 1 file changed, 448 insertions(+) create mode 100644 reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md new file mode 100644 index 000000000000..63621aae45b6 --- /dev/null +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md @@ -0,0 +1,448 @@ +--- +title: What's New in PowerShell 7.0 +description: New features and changes released in PowerShell 7.0 +ms.date: 01/21/2020 +--- + +# What's New in PowerShell 7.0 + +PowerShell 7 is the latest major release to PowerShell, the cross-platform (Windows, Linux, and +macOS) scripting language and automation engine for IT Management, DevOps pipelines, application +development and more. + +PowerShell 7... TODO + +To see a full list of improvements, check out +our detailed [changelogs](https://github.com/PowerShell/PowerShell/releases) on GitHub. + + +## Improved backwards compatibility with Windows PowerShell + +[Doc ref](Link)TODO + +## Improved VSCode PowerShell Extension + +[Using VSCode for PowerShell Development](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode?view=powershell-7) + +Visual Studio code is a lightweight powerful source code editor built to support your development +needs. With the addition of the PowerShell Extension, you have a complete management and automation +development platform, to handle your needs today, and as you automate to the future. + +TODO: Show powershell extension install +TODO: Show command-p ISE setting + +## Improved Foreach-Object with Parallelism support + +[Foreach-Object](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7) + +The Foreach-Object cmdlet, which iterates items in a collection, now has built-in parallelism with the new -Parallel parameter. + +TODO: examples + +## Introducing Secrets Management + +TODO: Doc link +TODO: Text +TODO: Example + +## Ternary operator + +TODO: Doc link +TODO: Text +TODO: Example + +## Pipeline chain operators + +[About Pipeline Chain Operators](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipeline_chain_operators?view=powershell-7) + +TODO: Text +TODO Example + +## Null Condition operators + +TODO: Doc link +TODO: Text +TODO: Example + +## New ErrorView and Get-Error cmdlets + +[Get-Error](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-error?view=powershell-7) + +The display of error messages has been improved to enhance the readability of interactive and script +errors with a new default view ConciseView. The views are user selectable through the preference +variable **$ErrorView**. + +The default view in PowerShell 7 is ConciseView, but previous views NormalView and CategoryView are still selectable by setting the preference variable $ErrorView + +```powershell +$ErrorView = 'Normalview' # Sets the error view to NormalView +$Errorview = 'ConciseView' # Sets the error view to ConciseView +``` + +With ConciseView, If an error is not from a script or parser error, then +it's a single line error message. + +```powershell +PS C:\> Get-Childitem -Path c:\notreal +``` + +```output +Get-ChildItem: Cannot find path ‘C:\notreal’ because it does not exist +``` + +If the error occurs during script execution or is a parsing error, you get a multiline error message +that contains the error, a pointer and error message showing where the error is in that line. If the +terminal doesn't support Virtual Terminal, then vt100 color codes are not used. + +```powershell +c:\>.\Myscript.ps1 +``` + +```output +MethodInvocationException: C:\GitHub\pri-tests\MyScript.ps1 +Line | + 2 | [System.Net.DNS]::GetHostByName('Notonline') + | ^ Exception calling "GetHostByName" with "1" argument(s): "No such host is known." +``` + +[!NOTE] A new property **ErrorAccentColor** is added to $Host.PrivateData to support changing the +accent color of the error message. If the terminal doesn't support Virtual Terminal, then vt100 +color codes are not used. + +A new cmdlet `Get-Error` will provide complete detailed view of the fully qualified error when +desired. By default the cmdlet displays the full details, including inner exceptions, of the last +error that occurred. + +```powershell +Get-Error +``` + +```output +# Truncated for brevity + +Exception : + ErrorRecord : + Exception : + Message : Cannot find path 'C:\notreal' because it does not exist. + HResult : -2146233087 + TargetObject : C:\notreal + CategoryInfo : ObjectNotFound: (C:\notreal:String) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : PathNotFound + ItemName : C:\notreal + SessionStateCategory : Drive + TargetSite : + Name : GetChildItems + DeclaringType : System.Management.Automation.SessionStateInternal + MemberType : Method + Module : System.Management.Automation.dll + StackTrace : +``` + +Get-Error supports pipelined passed errors by using the built in variable $error. Get-Error will +display all passed errors. + +```powershell +$Error | Get-Error +``` + +Get-Error supports the -Newest parameter, allowing you to specify how many errors from the current +session you wish displayed. + +```powershell +Get-Error -Newest 3 # Displays the lst three errors that occurred in the session +``` + +## New DSC Resource support with Invoke-DSCResource + +TODO: Doc link +TODO: Text +TODO: Example + +## New version notification + +TODO: Doc link +TODO: Text +TODO: Example + +## Migrating from Windows PowerShell 5.1 to PowerShell 7.0 + +TODO: Doc link +TODO: Text +TODO: Example + + +# Changelog from pre-release is here and complete - TODO formatting +TODO formatting for all the below + +## Breaking Changes + +- Make update notification support LTS and default channels (#11132) +- Update Test-Connection to work more like the one in Windows PowerShell (#10697) (Thanks @vexx32!) +- Preserve $? for ParenExpression, SubExpression and ArrayExpression (#11040) +- Set working directory to current directory in Start-Job (#10920) (Thanks @iSazonov!) +- Make $PSCulture consistently reflect in-session culture changes (#10138) (Thanks @iSazonov!) + +## Experimental Features + +- Provide Unix stat information in filesystem output (#11042) +- Support null-conditional operators ?. and ?[] in PowerShell language (#10960) +- Support using non-compatible Windows PowerShell modules in PowerShell Core (#10973) +- Implement Get-Error cmdlet as Experimental Feature (#10727,#10800) +- Add ConciseView for $ErrorView and update it to remove unnecessary text and not color entire line in red (#10641,#10724) +- Support the pipeline chain operators && and || in PowerShell language (#9849,#10825,#10836) +- Implement null coalescing (??) and null coalescing assignment (??=) operators (#10636) +- Support notification on pwsh startup when a new release is available and update notification message (#10689,#10777) +- Update PSDesiredStateConfiguration module version to 2.0.3 and bring new tests; enable compilation to MOF on non-Windows and use of Invoke-DSCResource without LCM (#10516) +- Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PowerShell Editor Services (#10338) (Thanks @KirkMunro!) +- Support ternary operator in PowerShell language (#10367) + +## Engine Updates and Fixes + +- Improvements in breakpoint APIs for remote scenarios (#11312) +- Fix PowerShell class definition leaking into another Runspace (#11273) +- Fix a regression in formatting caused by the FirstOrDefault primitive added in 7.0.0-Preview1 (#11258) +- Additional Microsoft Modules to track in PS7 Telemetry (#10751) +- Make approved features non-experimental (#11303) +- Update ConciseView to use TargetObject if applicable (#11075) +- Fix NullReferenceException in CompletionCompleters public methods (#11274) +- Fix apartment thread state check on non-Windows platforms (#11301) +- Update setting PSModulePath to concatenate the process and machine environment variables (#11276) +- Bump .NET Core to 3.1.0 (#11260) +- Fix detection of $PSHOME in front of $env:PATH (#11141) +- Allow pwsh to inherit $env:PSModulePath and enable powershell.exe to start correctly (#11057) +- Move to .NET Core 3.1 preview 1 (#10798) +- Refactor reparse tag checks in file system provider (#10431) (Thanks @iSazonov!) +- Replace CR and new line with a 0x23CE character in script logging (#10616) +- Fix a resource leak by unregistering the event handler from AppDomain.CurrentDomain.ProcessExit (#10626) +- Add support to ActionPreference.Break to break into debugger when Debug, Error, Information, Progress, Verbose or Warning messages are generated (#8205) (Thanks @KirkMunro!) +- Enable starting control panel add-ins within PowerShell Core without specifying .CPL extension. (#9828) + +## General Cmdlet Updates and Fixes + +- Fix for issue on Raspbian for setting date of file changes in UnixStat Experimental Feature (#11313) +- Add -AsPlainText to ConvertFrom-SecureString (#11142) +- Added WindowsPS version check for WinCompat (#11148) +- Fix error-reporting in some WinCompat scenarios (#11259) +- Add native binary resolver (#11032) (Thanks @iSazonov!) +- Update calculation of char width to respect CJK chars correctly (#11262) +- Add Unblock-File for macOS (#11137) +- Fix regression in Get-PSCallStack (#11210) (Thanks @iSazonov!) +- Remove autoloading of the ScheduledJob module when using Job cmdlets (#11194) +- Add OutputType to Get-Error cmdlet and preserve original typenames (#10856) +- Fix null reference in SupportsVirtualTerminal property (#11105) +- Add limit check in Get-WinEvent (#10648) (Thanks @iSazonov!) +- Fix command runtime so StopUpstreamCommandsException doesn't get populated in -ErrorVariable (#10840) +- Set the output encoding to [Console]::OutputEncoding for native commands (#10824) +- Support multi-line code blocks in examples (#10776) (Thanks @Greg-Smulko!) +- Add Culture parameter to Select-String cmdlet (#10943) (Thanks @iSazonov!) +- Fix Start-Job working directory path with trailing backslash (#11041) +- ConvertFrom-Json: Unwrap collections by default (#10861) (Thanks @danstur!) +- Use case-sensitive Hashtable for Group-Object cmdlet with -CaseSensitive and -AsHashtable switches (#11030) (Thanks @vexx32!) +- Handle exception if enumerating files fails when rebuilding path to have correct casing (#11014) +- Fix ConciseView to show Activity instead of myCommand (#11007) +- Allow web cmdlets to ignore HTTP error statuses (#10466) (Thanks @vdamewood!) +- Fix piping of more than one CommandInfo to Get-Command (#10929) +- Add back Get-Counter cmdlet for Windows (#10933) +- Make ConvertTo-Json treat [AutomationNull]::Value and [NullString]::Value as $null (#10957) +- Remove brackets from ipv6 address for SSH remoting (#10968) +- Fix crash if command sent to pwsh is just whitespace (#10977) +- Added cross-platform Get-Clipboard and Set-Clipboard (#10340) +- Fix setting original path of filesystem object to not have extra trailing slash (#10959) +- Support $null for ConvertTo-Json (#10947) +- Add back Out-Printer command on Windows (#10906) +- Fix Start-Job -WorkingDirectory with whitespace (#10951) +- Return default value when getting null for a setting in PSConfiguration.cs (#10963) (Thanks @iSazonov!) +- Handle IO exception as non-terminating (#10950) +- Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow (#10899) +- Take ComputerName via pipeline in Get-HotFix (#10852) (Thanks @kvprasoon!) +- Fix tab completion for parameters so that it shows common parameters as available (#10850) +- Fix GetCorrectCasedPath() to first check if any system file entries is returned before calling First() (#10930) +- Set working directory to current directory in Start-Job (#10920) (Thanks @iSazonov!) +- Change TabExpansion2 to not require -CursorColumn and treat as $InputScript.Length (#10849) +- Handle case where Host may not return Rows or Columns of screen (#10938) +- Fix use of accent colors for hosts that don't support them (#10937) +- Add back Update-List command (#10922) +- Update FWLink Id for Clear-RecycleBin (#10925) +- During tab completion, skip file if can't read file attributes (#10910) +- Add back Clear-RecycleBin for Windows (#10909) +- Add $env:__SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output (#10814) +- Add -NoEmphasize parameter to colorize Select-String output (#8963) (Thanks @derek-xia!) +- Add back Get-HotFix cmdlet (#10740) +- Make Add-Type usable in applications that host PowerShell (#10587) +- Use more effective evaluation order in LanguagePrimitives.IsNullLike() (#10781) (Thanks @vexx32!) +- Improve handling of mixed-collection piped input and piped streams of input in Format-Hex (#8674) (Thanks @vexx32!) +- Use type conversion in SSHConnection hashtables when value doesn't match expected type (#10720) (Thanks @SeeminglyScience!) +- Fix Get-Content -ReadCount 0 behavior when -TotalCount is set (#10749) (Thanks @eugenesmlv!) +- Reword access denied error message in Get-WinEvent (#10639) (Thanks @iSazonov!) +- Enable tab completion for variable assignment that is enum or type constrained (#10646) +- Remove unused SourceLength remoting property causing formatting issues (#10765) +- Add -Delimiter parameter to ConvertFrom-StringData (#10665) (Thanks @steviecoaster!) +- Add positional parameter for ScriptBlock when using Invoke-Command with SSH (#10721) (Thanks @machgo!) +- Show line context information if multiple lines but no script name for ConciseView (#10746) +- Add support for \\wsl$\ paths to file system provider (#10674) +- Add the missing token text for TokenKind.QuestionMark in parser (#10706) +- Set current working directory of each ForEach-Object -Parallel running script to the same location as the calling script. (#10672) +- Replace api-ms-win-core-file-l1-2-2.dll with Kernell32.dll for FindFirstStreamW and FindNextStreamW APIs (#10680) (Thanks @iSazonov!) +- Tweak help formatting script to be more StrictMode tolerant (#10563) +- Add -SecurityDescriptorSDDL parameter to New-Service (#10483) (Thanks @kvprasoon!) +- Remove informational output, consolidate ping usage in Test-Connection (#10478) (Thanks @vexx32!) +- Read special reparse points without accessing them (#10662) (Thanks @iSazonov!) +- Direct Clear-Host output to terminal (#10681) (Thanks @iSazonov!) +- Add back newline for grouping with Format-Table and -Property (#10653) +- Remove [ValidateNotNullOrEmpty] from -InputObject on Get-Random to allow empty string (#10644) +- Make suggestion system string distance algorithm case-insensitive (#10549) (Thanks @iSazonov!) +- Fix null reference exception in ForEach-Object -Parallel input processing (#10577) +- Add PowerShell Core group policy definitions (#10468) +- Update console host to support XTPUSHSGR/XTPOPSGR VT control sequences that are used in composability scenarios. (#10208) +- Add WorkingDirectory parameter to Start-Job (#10324) (Thanks @davinci26!) +- Remove the event handler that was causing breakpoint changes to be erroneously replicated to the host runspace debugger (#10503) (Thanks @KirkMunro!) +- Replace api-ms-win-core-job-12-1-0.dll with Kernell32.dll in Microsoft.PowerShell.Commands.NativeMethods P/Invoke API(#10417) (Thanks @iSazonov!) +- Fix wrong output for New-Service in variable assignment and -OutVariable (#10444) (Thanks @kvprasoon!) +- Fix global tool issues around exit code, command line parameters and path with spaces (#10461) +- Fix recursion into OneDrive - change FindFirstFileEx() to use SafeFindHandle type (#10405) +- Skip auto-loading PSReadLine on Windows if the NVDA screen reader is active (#10385) +- Increase built-with-PowerShell module versions to 7.0.0.0 (#10356) +- Add throwing an error in Add-Type if a type with the same name already exists (#9609) (Thanks @iSazonov!) + + + +## Performance + +- Avoid using closure in Parser.SaveError (#11006) +- Improve the caching when creating new Regex instances (#10657) (Thanks @iSazonov!) +- Improve processing of the PowerShell built-in type data from types.ps1xml, typesV3.ps1xml and GetEvent.types.ps1xml (#10898) +- Update PSConfiguration.ReadValueFromFile to make it faster and more memory efficient (#10839) +- Add minor performance improvements for runspace initialization (#10569) (Thanks @iSazonov!) +- Make ForEach-Object faster for its commonly used scenarios (#10454) and fix ForEach-Object -Parallel performance problem with many runspaces (#10455) + + +## Code Cleanup + +- Change comment and element text to meet Microsoft standards (#11304) +- Cleanup style issues in Compiler.cs (#10368) (Thanks @iSazonov!) +- Remove the unused type converter for CommaDelimitedStringCollection (#11000) (Thanks @iSazonov!) +- Cleanup style in InitialSessionState.cs (#10865) (Thanks @iSazonov!) +- Code clean up for PSSession class (#11001) +- Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' feature (#10974) +- Fix style issues (#10998) (Thanks @iSazonov!) +- Cleanup: use the built-in type alias (#10882) (Thanks @iSazonov!) +- Remove the unused setting key ConsolePrompting and avoid unnecessary string creation when querying ExecutionPolicy setting (#10985) +- Disable update notification check for daily builds (#10903) (Thanks @bergmeister!) +- Reinstate debugging API lost in #10338 (#10808) +- Remove WorkflowJobSourceAdapter reference that is no longer used (#10326) (Thanks @KirkMunro!) +- Cleanup COM interfaces in jump list code by fixing PreserveSig attributes (#9899) (Thanks @weltkante!) +- Add a comment describing why -ia is not the alias for -InformationAction common parameter (#10703) (Thanks @KirkMunro!) +- Rename InvokeCommandCmdlet.cs to InvokeExpressionCommand.cs (#10659) (Thanks @kilasuit!) +- Add minor code cleanups related to update notifications (#10698) +- Remove deprecated workflow logic from the remoting setup scripts (#10320) (Thanks @KirkMunro!) +- Update help format to use proper case (#10678) (Thanks @tnieto88!) +- Clean up CodeFactor style issues coming in commits for the last month (#10591) (Thanks @iSazonov!) +- Fix typo in description of PSTernaryOperator experimental feature (#10586) (Thanks @bergmeister!) +- Convert ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables (#10317) (Thanks @KirkMunro!) +- Replace ArrayList with List to get more readable and reliable code without changing functionality (#10333) (Thanks @iSazonov!) +- Make code style fixes to TestConnectionCommand (#10439) (Thanks @vexx32!) +- Cleanup AutomationEngine and remove extra SetSessionStateDrive method call (#10416) (Thanks @iSazonov!) +- Rename default ParameterSetName back to Delimiter for ConvertTo-Csv and ConvertFrom-Csv (#10425) + +## Tools + +- Add default setting for the SDKToUse property so that it builds in VS (#11085) +- Install-Powershell.ps1: Add parameter to use MSI installation (#10921) (Thanks @MJECloud!) +- Add basic examples for install-powershell.ps1 (#10914) (Thanks @kilasuit!) +- Make Install-PowerShellRemoting.ps1 handle empty string in PowerShellHome parameter (#10526) (Thanks @Orca88!) +- Switch from /etc/lsb-release to /etc/os-release in install-powershell.sh (#10773) (Thanks @Himura2la!) +- Check pwsh.exe and pwsh in daily version on Windows (#10738) (Thanks @centreboard!) +- Remove unneeded tap in installpsh-osx.sh (#10752) +- Update install-powershell.ps1 to check for already installed daily build (#10489) + + +## Tests + +- Make unreliable DSC test pending (#11131) +- Fix stringdata test to correctly validate keys of hashtables (#10810) +- Unload test modules (#11061) (Thanks @iSazonov!) +- Increase time between retries of testing URL (#11015) +- Update tests to accurately describe test actions. (#10928) (Thanks @romero126!) +- Temporary skip the flaky test TestAppDomainProcessExitEvenHandlerNotLeaking (#10827) +- Make the event handler leaking test stable (#10790) +- Sync capitalization in CI YAML (#10767) (Thanks @RDIL!) +- Add test for the event handler leaking fix (#10768) +- Add Get-ChildItem test (#10507) (Thanks @iSazonov!) +- Replace ambiguous language for tests from switch to parameter for accuracy (#10666) (Thanks @romero126!) +- Add experimental check to ForEach-Object -Parallel tests (#10354) (Thanks @KirkMunro!) +- Update tests for Alpine validation (#10428) + +## Build and Package Improvements + +- Fix Nuget package signing for Coordinated Package build (#11316) +- Update dependencies from PowerShell Gallery and NuGet (#11323) +- Bump Microsoft.ApplicationInsights from 2.11.0 to 2.12.0 (#11305) +- Bump Microsoft.CodeAnalysis.CSharp from 3.3.1 to 3.4.0 (#11265) +- Updates packages for Debian 10 and 11 (#11236) +- Only enable experimental features prior to RC (#11162) +- Update macOS minimum version (#11163) +- Bump NJsonSchema from 10.0.27 to 10.0.28 (#11170) +- Updating links in README.md and metadata.json for Preview.5 (#10854) +- Select the files for compliance tests which are owned by PowerShell (#10837) +- Allow win7x86 msix package to build. (Internal 10515) +- Allow semantic versions to be passed to NormalizeVersion function (#11087) +- Bump .NET core framework to 3.1-preview.3 (#11079) +- Bump PSReadLine from 2.0.0-beta5 to 2.0.0-beta6 in /src/Modules (#11078) +- Bump Newtonsoft.Json from 12.0.2 to 12.0.3 (#11037) (#11038) +- Add Debian 10, 11 and CentOS 8 packages (#11028) +- Upload Build-Info Json file with the ReleaseDate field (#10986) +- Bump .NET core framework to 3.1-preview.2 (#10993) +- Enable build of x86 MSIX package (#10934) +- Update the dotnet SDK install script URL in build.psm1 (#10927) +- Bump Markdig.Signed from 0.17.1 to 0.18.0 (#10887) +- Bump ThreadJob from 2.0.1 to 2.0.2 (#10886) +- Update AppX Manifest and Packaging module to conform to MS Store requirements (#10878) +- Update package reference for PowerShell SDK to preview.5 (Internal 10295) +- Update ThirdPartyNotices.txt (#10834) +- Bump Microsoft.PowerShell.Native to 7.0.0-preview.3 (#10826) +- Bump Microsoft.ApplicationInsights from 2.10.0 to 2.11.0 (#10608) +- Bump NJsonSchema from 10.0.24 to 10.0.27 (#10756) +- Add MacPorts support to the build system (#10736) (Thanks @Lucius-Q-User!) +- Bump PackageManagement from 1.4.4 to 1.4.5 (#10728) +- Bump NJsonSchema from 10.0.23 to 10.0.24 (#10635) +- Add environment variable to differentiate client/server telemetry in MSI (#10612) +- Bump PSDesiredStateConfiguration from 2.0.3 to 2.0.4 (#10603) +- Bump Microsoft.CodeAnalysis.CSharp from 3.2.1 to 3.3.1 (#10607) +- Update to .Net Core 3.0 RTM (#10604) (Thanks @bergmeister!) +- Update MSIX packaging so the version to Windows Store requirements (#10588) +- Bump PowerShellGet version from 2.2 to 2.2.1 (#10382) +- Bump PackageManagement version from 1.4.3 to 1.4.4 (#10383) +- Update README.md and metadata.json for 7.0.0-preview.4 (Internal 10011) +- Upgrade .Net Core 3.0 version from Preview 9 to RC1 (#10552) (Thanks @bergmeister!) +- Fix ExperimentalFeature list generation (Internal 9996) +- Bump PSReadLine version from 2.0.0-beta4 to 2.0.0-beta5 (#10536) +- Fix release build script to set release tag +- Update version of Microsoft.PowerShell.Native to 7.0.0-preview.2 (#10519) +- Upgrade to Netcoreapp3.0 preview9 (#10484) (Thanks @bergmeister!) +- Make sure the daily coordinated build, knows it is a daily build (#10464) +- Update the combined package build to release the daily builds (#10449) +- Remove appveyor reference (#10445) (Thanks @RDIL!) +- Bump NJsonSchema version from 10.0.22 to 10.0.23 (#10421) +- Remove the deletion of linux-x64 build folder because some dependencies for Alpine need it (#10407) + + +## Documentation and Help Content + +- Refactor change logs into one log per release (#11165) +- Fix FWLinks for PowerShell 7 online help documents (#11071) +- Update CONTRIBUTING.md (#11096) (Thanks @mklement0!) +- Fix installation doc links in README.md (#11083) +- Adds examples to install-powershell.ps1 script (#11024) (Thanks @kilasuit!) +- Fix to Select-String emphasis and Import-DscResource in CHANGELOG.md (#10890) +- Remove the stale link from powershell-beginners-guide.md (#10926) +- Merge stable and servicing change logs (#10527) +- Update used .NET version in build docs (#10775) (Thanks @Greg-Smulko!) +- Replace links from MSDN to docs.microsoft.com in powershell-beginners-guide.md (#10778) (Thanks @iSazonov!) +- Fix broken DSC overview link (#10702) +- Update Support_Question.md to link to Stack Overflow as another community resource (#10638) (Thanks @mklement0!) +- Add processor architecture to distribution request template (#10661) +- Add new PowerShell MoL book to learning PowerShell docs (#10602) +- Update README.md and metadata for v6.1.6 and v6.2.3 releases (#10523) +- Fix a typo in README.md (#10465) (Thanks @vedhasp!) +- Add a reference to PSKoans module to Learning Resources documentation (#10369) (Thanks @vexx32!) +- Update README.md and metadata.json for 7.0.0-preview.3 (#10393) From 30e51554743b77c402ae8e1198b063c4b0f51447 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Wed, 8 Jan 2020 12:21:35 -0800 Subject: [PATCH 2/8] fixed format issue line 268 --- .../docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md index 63621aae45b6..bb908a4ddfa8 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md @@ -265,7 +265,7 @@ TODO formatting for all the below - Update FWLink Id for Clear-RecycleBin (#10925) - During tab completion, skip file if can't read file attributes (#10910) - Add back Clear-RecycleBin for Windows (#10909) -- Add $env:__SuppressAnsiEscapeSequences to control whether to have VT escape sequence in output (#10814) +- Add '$env:__SuppressAnsiEscapeSequences' to control whether to have VT escape sequence in output (#10814) - Add -NoEmphasize parameter to colorize Select-String output (#8963) (Thanks @derek-xia!) - Add back Get-HotFix cmdlet (#10740) - Make Add-Type usable in applications that host PowerShell (#10587) From ee2344d03a5103d0f81eef7eefb783bced0ca267 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Wed, 8 Jan 2020 12:22:42 -0800 Subject: [PATCH 3/8] fixed format issue line 268 --- .../docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md index bb908a4ddfa8..b1d912bee11d 100644 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md +++ b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md @@ -265,7 +265,7 @@ TODO formatting for all the below - Update FWLink Id for Clear-RecycleBin (#10925) - During tab completion, skip file if can't read file attributes (#10910) - Add back Clear-RecycleBin for Windows (#10909) -- Add '$env:__SuppressAnsiEscapeSequences' to control whether to have VT escape sequence in output (#10814) +- Add `$env:__SuppressAnsiEscapeSequences` to control whether to have VT escape sequence in output (#10814) - Add -NoEmphasize parameter to colorize Select-String output (#8963) (Thanks @derek-xia!) - Add back Get-HotFix cmdlet (#10740) - Make Add-Type usable in applications that host PowerShell (#10587) From b46dd1c01b5be123ba1058e757e2810a75c4e6f4 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Fri, 10 Jan 2020 14:54:38 -0800 Subject: [PATCH 4/8] removed Whats NEw from Staging --- .../whats-new/What-s-New-in-PowerShell-70.md | 448 ------------------ 1 file changed, 448 deletions(-) delete mode 100644 reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md diff --git a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md b/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md deleted file mode 100644 index b1d912bee11d..000000000000 --- a/reference/docs-conceptual/whats-new/What-s-New-in-PowerShell-70.md +++ /dev/null @@ -1,448 +0,0 @@ ---- -title: What's New in PowerShell 7.0 -description: New features and changes released in PowerShell 7.0 -ms.date: 01/21/2020 ---- - -# What's New in PowerShell 7.0 - -PowerShell 7 is the latest major release to PowerShell, the cross-platform (Windows, Linux, and -macOS) scripting language and automation engine for IT Management, DevOps pipelines, application -development and more. - -PowerShell 7... TODO - -To see a full list of improvements, check out -our detailed [changelogs](https://github.com/PowerShell/PowerShell/releases) on GitHub. - - -## Improved backwards compatibility with Windows PowerShell - -[Doc ref](Link)TODO - -## Improved VSCode PowerShell Extension - -[Using VSCode for PowerShell Development](https://docs.microsoft.com/en-us/powershell/scripting/components/vscode/using-vscode?view=powershell-7) - -Visual Studio code is a lightweight powerful source code editor built to support your development -needs. With the addition of the PowerShell Extension, you have a complete management and automation -development platform, to handle your needs today, and as you automate to the future. - -TODO: Show powershell extension install -TODO: Show command-p ISE setting - -## Improved Foreach-Object with Parallelism support - -[Foreach-Object](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/foreach-object?view=powershell-7) - -The Foreach-Object cmdlet, which iterates items in a collection, now has built-in parallelism with the new -Parallel parameter. - -TODO: examples - -## Introducing Secrets Management - -TODO: Doc link -TODO: Text -TODO: Example - -## Ternary operator - -TODO: Doc link -TODO: Text -TODO: Example - -## Pipeline chain operators - -[About Pipeline Chain Operators](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipeline_chain_operators?view=powershell-7) - -TODO: Text -TODO Example - -## Null Condition operators - -TODO: Doc link -TODO: Text -TODO: Example - -## New ErrorView and Get-Error cmdlets - -[Get-Error](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-error?view=powershell-7) - -The display of error messages has been improved to enhance the readability of interactive and script -errors with a new default view ConciseView. The views are user selectable through the preference -variable **$ErrorView**. - -The default view in PowerShell 7 is ConciseView, but previous views NormalView and CategoryView are still selectable by setting the preference variable $ErrorView - -```powershell -$ErrorView = 'Normalview' # Sets the error view to NormalView -$Errorview = 'ConciseView' # Sets the error view to ConciseView -``` - -With ConciseView, If an error is not from a script or parser error, then -it's a single line error message. - -```powershell -PS C:\> Get-Childitem -Path c:\notreal -``` - -```output -Get-ChildItem: Cannot find path ‘C:\notreal’ because it does not exist -``` - -If the error occurs during script execution or is a parsing error, you get a multiline error message -that contains the error, a pointer and error message showing where the error is in that line. If the -terminal doesn't support Virtual Terminal, then vt100 color codes are not used. - -```powershell -c:\>.\Myscript.ps1 -``` - -```output -MethodInvocationException: C:\GitHub\pri-tests\MyScript.ps1 -Line | - 2 | [System.Net.DNS]::GetHostByName('Notonline') - | ^ Exception calling "GetHostByName" with "1" argument(s): "No such host is known." -``` - -[!NOTE] A new property **ErrorAccentColor** is added to $Host.PrivateData to support changing the -accent color of the error message. If the terminal doesn't support Virtual Terminal, then vt100 -color codes are not used. - -A new cmdlet `Get-Error` will provide complete detailed view of the fully qualified error when -desired. By default the cmdlet displays the full details, including inner exceptions, of the last -error that occurred. - -```powershell -Get-Error -``` - -```output -# Truncated for brevity - -Exception : - ErrorRecord : - Exception : - Message : Cannot find path 'C:\notreal' because it does not exist. - HResult : -2146233087 - TargetObject : C:\notreal - CategoryInfo : ObjectNotFound: (C:\notreal:String) [], ParentContainsErrorRecordException - FullyQualifiedErrorId : PathNotFound - ItemName : C:\notreal - SessionStateCategory : Drive - TargetSite : - Name : GetChildItems - DeclaringType : System.Management.Automation.SessionStateInternal - MemberType : Method - Module : System.Management.Automation.dll - StackTrace : -``` - -Get-Error supports pipelined passed errors by using the built in variable $error. Get-Error will -display all passed errors. - -```powershell -$Error | Get-Error -``` - -Get-Error supports the -Newest parameter, allowing you to specify how many errors from the current -session you wish displayed. - -```powershell -Get-Error -Newest 3 # Displays the lst three errors that occurred in the session -``` - -## New DSC Resource support with Invoke-DSCResource - -TODO: Doc link -TODO: Text -TODO: Example - -## New version notification - -TODO: Doc link -TODO: Text -TODO: Example - -## Migrating from Windows PowerShell 5.1 to PowerShell 7.0 - -TODO: Doc link -TODO: Text -TODO: Example - - -# Changelog from pre-release is here and complete - TODO formatting -TODO formatting for all the below - -## Breaking Changes - -- Make update notification support LTS and default channels (#11132) -- Update Test-Connection to work more like the one in Windows PowerShell (#10697) (Thanks @vexx32!) -- Preserve $? for ParenExpression, SubExpression and ArrayExpression (#11040) -- Set working directory to current directory in Start-Job (#10920) (Thanks @iSazonov!) -- Make $PSCulture consistently reflect in-session culture changes (#10138) (Thanks @iSazonov!) - -## Experimental Features - -- Provide Unix stat information in filesystem output (#11042) -- Support null-conditional operators ?. and ?[] in PowerShell language (#10960) -- Support using non-compatible Windows PowerShell modules in PowerShell Core (#10973) -- Implement Get-Error cmdlet as Experimental Feature (#10727,#10800) -- Add ConciseView for $ErrorView and update it to remove unnecessary text and not color entire line in red (#10641,#10724) -- Support the pipeline chain operators && and || in PowerShell language (#9849,#10825,#10836) -- Implement null coalescing (??) and null coalescing assignment (??=) operators (#10636) -- Support notification on pwsh startup when a new release is available and update notification message (#10689,#10777) -- Update PSDesiredStateConfiguration module version to 2.0.3 and bring new tests; enable compilation to MOF on non-Windows and use of Invoke-DSCResource without LCM (#10516) -- Add APIs for breakpoint management in runspaces and enable attach to process without BreakAll for PowerShell Editor Services (#10338) (Thanks @KirkMunro!) -- Support ternary operator in PowerShell language (#10367) - -## Engine Updates and Fixes - -- Improvements in breakpoint APIs for remote scenarios (#11312) -- Fix PowerShell class definition leaking into another Runspace (#11273) -- Fix a regression in formatting caused by the FirstOrDefault primitive added in 7.0.0-Preview1 (#11258) -- Additional Microsoft Modules to track in PS7 Telemetry (#10751) -- Make approved features non-experimental (#11303) -- Update ConciseView to use TargetObject if applicable (#11075) -- Fix NullReferenceException in CompletionCompleters public methods (#11274) -- Fix apartment thread state check on non-Windows platforms (#11301) -- Update setting PSModulePath to concatenate the process and machine environment variables (#11276) -- Bump .NET Core to 3.1.0 (#11260) -- Fix detection of $PSHOME in front of $env:PATH (#11141) -- Allow pwsh to inherit $env:PSModulePath and enable powershell.exe to start correctly (#11057) -- Move to .NET Core 3.1 preview 1 (#10798) -- Refactor reparse tag checks in file system provider (#10431) (Thanks @iSazonov!) -- Replace CR and new line with a 0x23CE character in script logging (#10616) -- Fix a resource leak by unregistering the event handler from AppDomain.CurrentDomain.ProcessExit (#10626) -- Add support to ActionPreference.Break to break into debugger when Debug, Error, Information, Progress, Verbose or Warning messages are generated (#8205) (Thanks @KirkMunro!) -- Enable starting control panel add-ins within PowerShell Core without specifying .CPL extension. (#9828) - -## General Cmdlet Updates and Fixes - -- Fix for issue on Raspbian for setting date of file changes in UnixStat Experimental Feature (#11313) -- Add -AsPlainText to ConvertFrom-SecureString (#11142) -- Added WindowsPS version check for WinCompat (#11148) -- Fix error-reporting in some WinCompat scenarios (#11259) -- Add native binary resolver (#11032) (Thanks @iSazonov!) -- Update calculation of char width to respect CJK chars correctly (#11262) -- Add Unblock-File for macOS (#11137) -- Fix regression in Get-PSCallStack (#11210) (Thanks @iSazonov!) -- Remove autoloading of the ScheduledJob module when using Job cmdlets (#11194) -- Add OutputType to Get-Error cmdlet and preserve original typenames (#10856) -- Fix null reference in SupportsVirtualTerminal property (#11105) -- Add limit check in Get-WinEvent (#10648) (Thanks @iSazonov!) -- Fix command runtime so StopUpstreamCommandsException doesn't get populated in -ErrorVariable (#10840) -- Set the output encoding to [Console]::OutputEncoding for native commands (#10824) -- Support multi-line code blocks in examples (#10776) (Thanks @Greg-Smulko!) -- Add Culture parameter to Select-String cmdlet (#10943) (Thanks @iSazonov!) -- Fix Start-Job working directory path with trailing backslash (#11041) -- ConvertFrom-Json: Unwrap collections by default (#10861) (Thanks @danstur!) -- Use case-sensitive Hashtable for Group-Object cmdlet with -CaseSensitive and -AsHashtable switches (#11030) (Thanks @vexx32!) -- Handle exception if enumerating files fails when rebuilding path to have correct casing (#11014) -- Fix ConciseView to show Activity instead of myCommand (#11007) -- Allow web cmdlets to ignore HTTP error statuses (#10466) (Thanks @vdamewood!) -- Fix piping of more than one CommandInfo to Get-Command (#10929) -- Add back Get-Counter cmdlet for Windows (#10933) -- Make ConvertTo-Json treat [AutomationNull]::Value and [NullString]::Value as $null (#10957) -- Remove brackets from ipv6 address for SSH remoting (#10968) -- Fix crash if command sent to pwsh is just whitespace (#10977) -- Added cross-platform Get-Clipboard and Set-Clipboard (#10340) -- Fix setting original path of filesystem object to not have extra trailing slash (#10959) -- Support $null for ConvertTo-Json (#10947) -- Add back Out-Printer command on Windows (#10906) -- Fix Start-Job -WorkingDirectory with whitespace (#10951) -- Return default value when getting null for a setting in PSConfiguration.cs (#10963) (Thanks @iSazonov!) -- Handle IO exception as non-terminating (#10950) -- Add GraphicalHost assembly to enable Out-GridView, Show-Command, and Get-Help -ShowWindow (#10899) -- Take ComputerName via pipeline in Get-HotFix (#10852) (Thanks @kvprasoon!) -- Fix tab completion for parameters so that it shows common parameters as available (#10850) -- Fix GetCorrectCasedPath() to first check if any system file entries is returned before calling First() (#10930) -- Set working directory to current directory in Start-Job (#10920) (Thanks @iSazonov!) -- Change TabExpansion2 to not require -CursorColumn and treat as $InputScript.Length (#10849) -- Handle case where Host may not return Rows or Columns of screen (#10938) -- Fix use of accent colors for hosts that don't support them (#10937) -- Add back Update-List command (#10922) -- Update FWLink Id for Clear-RecycleBin (#10925) -- During tab completion, skip file if can't read file attributes (#10910) -- Add back Clear-RecycleBin for Windows (#10909) -- Add `$env:__SuppressAnsiEscapeSequences` to control whether to have VT escape sequence in output (#10814) -- Add -NoEmphasize parameter to colorize Select-String output (#8963) (Thanks @derek-xia!) -- Add back Get-HotFix cmdlet (#10740) -- Make Add-Type usable in applications that host PowerShell (#10587) -- Use more effective evaluation order in LanguagePrimitives.IsNullLike() (#10781) (Thanks @vexx32!) -- Improve handling of mixed-collection piped input and piped streams of input in Format-Hex (#8674) (Thanks @vexx32!) -- Use type conversion in SSHConnection hashtables when value doesn't match expected type (#10720) (Thanks @SeeminglyScience!) -- Fix Get-Content -ReadCount 0 behavior when -TotalCount is set (#10749) (Thanks @eugenesmlv!) -- Reword access denied error message in Get-WinEvent (#10639) (Thanks @iSazonov!) -- Enable tab completion for variable assignment that is enum or type constrained (#10646) -- Remove unused SourceLength remoting property causing formatting issues (#10765) -- Add -Delimiter parameter to ConvertFrom-StringData (#10665) (Thanks @steviecoaster!) -- Add positional parameter for ScriptBlock when using Invoke-Command with SSH (#10721) (Thanks @machgo!) -- Show line context information if multiple lines but no script name for ConciseView (#10746) -- Add support for \\wsl$\ paths to file system provider (#10674) -- Add the missing token text for TokenKind.QuestionMark in parser (#10706) -- Set current working directory of each ForEach-Object -Parallel running script to the same location as the calling script. (#10672) -- Replace api-ms-win-core-file-l1-2-2.dll with Kernell32.dll for FindFirstStreamW and FindNextStreamW APIs (#10680) (Thanks @iSazonov!) -- Tweak help formatting script to be more StrictMode tolerant (#10563) -- Add -SecurityDescriptorSDDL parameter to New-Service (#10483) (Thanks @kvprasoon!) -- Remove informational output, consolidate ping usage in Test-Connection (#10478) (Thanks @vexx32!) -- Read special reparse points without accessing them (#10662) (Thanks @iSazonov!) -- Direct Clear-Host output to terminal (#10681) (Thanks @iSazonov!) -- Add back newline for grouping with Format-Table and -Property (#10653) -- Remove [ValidateNotNullOrEmpty] from -InputObject on Get-Random to allow empty string (#10644) -- Make suggestion system string distance algorithm case-insensitive (#10549) (Thanks @iSazonov!) -- Fix null reference exception in ForEach-Object -Parallel input processing (#10577) -- Add PowerShell Core group policy definitions (#10468) -- Update console host to support XTPUSHSGR/XTPOPSGR VT control sequences that are used in composability scenarios. (#10208) -- Add WorkingDirectory parameter to Start-Job (#10324) (Thanks @davinci26!) -- Remove the event handler that was causing breakpoint changes to be erroneously replicated to the host runspace debugger (#10503) (Thanks @KirkMunro!) -- Replace api-ms-win-core-job-12-1-0.dll with Kernell32.dll in Microsoft.PowerShell.Commands.NativeMethods P/Invoke API(#10417) (Thanks @iSazonov!) -- Fix wrong output for New-Service in variable assignment and -OutVariable (#10444) (Thanks @kvprasoon!) -- Fix global tool issues around exit code, command line parameters and path with spaces (#10461) -- Fix recursion into OneDrive - change FindFirstFileEx() to use SafeFindHandle type (#10405) -- Skip auto-loading PSReadLine on Windows if the NVDA screen reader is active (#10385) -- Increase built-with-PowerShell module versions to 7.0.0.0 (#10356) -- Add throwing an error in Add-Type if a type with the same name already exists (#9609) (Thanks @iSazonov!) - - - -## Performance - -- Avoid using closure in Parser.SaveError (#11006) -- Improve the caching when creating new Regex instances (#10657) (Thanks @iSazonov!) -- Improve processing of the PowerShell built-in type data from types.ps1xml, typesV3.ps1xml and GetEvent.types.ps1xml (#10898) -- Update PSConfiguration.ReadValueFromFile to make it faster and more memory efficient (#10839) -- Add minor performance improvements for runspace initialization (#10569) (Thanks @iSazonov!) -- Make ForEach-Object faster for its commonly used scenarios (#10454) and fix ForEach-Object -Parallel performance problem with many runspaces (#10455) - - -## Code Cleanup - -- Change comment and element text to meet Microsoft standards (#11304) -- Cleanup style issues in Compiler.cs (#10368) (Thanks @iSazonov!) -- Remove the unused type converter for CommaDelimitedStringCollection (#11000) (Thanks @iSazonov!) -- Cleanup style in InitialSessionState.cs (#10865) (Thanks @iSazonov!) -- Code clean up for PSSession class (#11001) -- Remove the not-working 'run Update-Help from Get-Help when Get-Help runs for the first time' feature (#10974) -- Fix style issues (#10998) (Thanks @iSazonov!) -- Cleanup: use the built-in type alias (#10882) (Thanks @iSazonov!) -- Remove the unused setting key ConsolePrompting and avoid unnecessary string creation when querying ExecutionPolicy setting (#10985) -- Disable update notification check for daily builds (#10903) (Thanks @bergmeister!) -- Reinstate debugging API lost in #10338 (#10808) -- Remove WorkflowJobSourceAdapter reference that is no longer used (#10326) (Thanks @KirkMunro!) -- Cleanup COM interfaces in jump list code by fixing PreserveSig attributes (#9899) (Thanks @weltkante!) -- Add a comment describing why -ia is not the alias for -InformationAction common parameter (#10703) (Thanks @KirkMunro!) -- Rename InvokeCommandCmdlet.cs to InvokeExpressionCommand.cs (#10659) (Thanks @kilasuit!) -- Add minor code cleanups related to update notifications (#10698) -- Remove deprecated workflow logic from the remoting setup scripts (#10320) (Thanks @KirkMunro!) -- Update help format to use proper case (#10678) (Thanks @tnieto88!) -- Clean up CodeFactor style issues coming in commits for the last month (#10591) (Thanks @iSazonov!) -- Fix typo in description of PSTernaryOperator experimental feature (#10586) (Thanks @bergmeister!) -- Convert ActionPreference.Suspend enumeration value into a non-supported, reserved state, and remove restriction on using ActionPreference.Ignore in preference variables (#10317) (Thanks @KirkMunro!) -- Replace ArrayList with List to get more readable and reliable code without changing functionality (#10333) (Thanks @iSazonov!) -- Make code style fixes to TestConnectionCommand (#10439) (Thanks @vexx32!) -- Cleanup AutomationEngine and remove extra SetSessionStateDrive method call (#10416) (Thanks @iSazonov!) -- Rename default ParameterSetName back to Delimiter for ConvertTo-Csv and ConvertFrom-Csv (#10425) - -## Tools - -- Add default setting for the SDKToUse property so that it builds in VS (#11085) -- Install-Powershell.ps1: Add parameter to use MSI installation (#10921) (Thanks @MJECloud!) -- Add basic examples for install-powershell.ps1 (#10914) (Thanks @kilasuit!) -- Make Install-PowerShellRemoting.ps1 handle empty string in PowerShellHome parameter (#10526) (Thanks @Orca88!) -- Switch from /etc/lsb-release to /etc/os-release in install-powershell.sh (#10773) (Thanks @Himura2la!) -- Check pwsh.exe and pwsh in daily version on Windows (#10738) (Thanks @centreboard!) -- Remove unneeded tap in installpsh-osx.sh (#10752) -- Update install-powershell.ps1 to check for already installed daily build (#10489) - - -## Tests - -- Make unreliable DSC test pending (#11131) -- Fix stringdata test to correctly validate keys of hashtables (#10810) -- Unload test modules (#11061) (Thanks @iSazonov!) -- Increase time between retries of testing URL (#11015) -- Update tests to accurately describe test actions. (#10928) (Thanks @romero126!) -- Temporary skip the flaky test TestAppDomainProcessExitEvenHandlerNotLeaking (#10827) -- Make the event handler leaking test stable (#10790) -- Sync capitalization in CI YAML (#10767) (Thanks @RDIL!) -- Add test for the event handler leaking fix (#10768) -- Add Get-ChildItem test (#10507) (Thanks @iSazonov!) -- Replace ambiguous language for tests from switch to parameter for accuracy (#10666) (Thanks @romero126!) -- Add experimental check to ForEach-Object -Parallel tests (#10354) (Thanks @KirkMunro!) -- Update tests for Alpine validation (#10428) - -## Build and Package Improvements - -- Fix Nuget package signing for Coordinated Package build (#11316) -- Update dependencies from PowerShell Gallery and NuGet (#11323) -- Bump Microsoft.ApplicationInsights from 2.11.0 to 2.12.0 (#11305) -- Bump Microsoft.CodeAnalysis.CSharp from 3.3.1 to 3.4.0 (#11265) -- Updates packages for Debian 10 and 11 (#11236) -- Only enable experimental features prior to RC (#11162) -- Update macOS minimum version (#11163) -- Bump NJsonSchema from 10.0.27 to 10.0.28 (#11170) -- Updating links in README.md and metadata.json for Preview.5 (#10854) -- Select the files for compliance tests which are owned by PowerShell (#10837) -- Allow win7x86 msix package to build. (Internal 10515) -- Allow semantic versions to be passed to NormalizeVersion function (#11087) -- Bump .NET core framework to 3.1-preview.3 (#11079) -- Bump PSReadLine from 2.0.0-beta5 to 2.0.0-beta6 in /src/Modules (#11078) -- Bump Newtonsoft.Json from 12.0.2 to 12.0.3 (#11037) (#11038) -- Add Debian 10, 11 and CentOS 8 packages (#11028) -- Upload Build-Info Json file with the ReleaseDate field (#10986) -- Bump .NET core framework to 3.1-preview.2 (#10993) -- Enable build of x86 MSIX package (#10934) -- Update the dotnet SDK install script URL in build.psm1 (#10927) -- Bump Markdig.Signed from 0.17.1 to 0.18.0 (#10887) -- Bump ThreadJob from 2.0.1 to 2.0.2 (#10886) -- Update AppX Manifest and Packaging module to conform to MS Store requirements (#10878) -- Update package reference for PowerShell SDK to preview.5 (Internal 10295) -- Update ThirdPartyNotices.txt (#10834) -- Bump Microsoft.PowerShell.Native to 7.0.0-preview.3 (#10826) -- Bump Microsoft.ApplicationInsights from 2.10.0 to 2.11.0 (#10608) -- Bump NJsonSchema from 10.0.24 to 10.0.27 (#10756) -- Add MacPorts support to the build system (#10736) (Thanks @Lucius-Q-User!) -- Bump PackageManagement from 1.4.4 to 1.4.5 (#10728) -- Bump NJsonSchema from 10.0.23 to 10.0.24 (#10635) -- Add environment variable to differentiate client/server telemetry in MSI (#10612) -- Bump PSDesiredStateConfiguration from 2.0.3 to 2.0.4 (#10603) -- Bump Microsoft.CodeAnalysis.CSharp from 3.2.1 to 3.3.1 (#10607) -- Update to .Net Core 3.0 RTM (#10604) (Thanks @bergmeister!) -- Update MSIX packaging so the version to Windows Store requirements (#10588) -- Bump PowerShellGet version from 2.2 to 2.2.1 (#10382) -- Bump PackageManagement version from 1.4.3 to 1.4.4 (#10383) -- Update README.md and metadata.json for 7.0.0-preview.4 (Internal 10011) -- Upgrade .Net Core 3.0 version from Preview 9 to RC1 (#10552) (Thanks @bergmeister!) -- Fix ExperimentalFeature list generation (Internal 9996) -- Bump PSReadLine version from 2.0.0-beta4 to 2.0.0-beta5 (#10536) -- Fix release build script to set release tag -- Update version of Microsoft.PowerShell.Native to 7.0.0-preview.2 (#10519) -- Upgrade to Netcoreapp3.0 preview9 (#10484) (Thanks @bergmeister!) -- Make sure the daily coordinated build, knows it is a daily build (#10464) -- Update the combined package build to release the daily builds (#10449) -- Remove appveyor reference (#10445) (Thanks @RDIL!) -- Bump NJsonSchema version from 10.0.22 to 10.0.23 (#10421) -- Remove the deletion of linux-x64 build folder because some dependencies for Alpine need it (#10407) - - -## Documentation and Help Content - -- Refactor change logs into one log per release (#11165) -- Fix FWLinks for PowerShell 7 online help documents (#11071) -- Update CONTRIBUTING.md (#11096) (Thanks @mklement0!) -- Fix installation doc links in README.md (#11083) -- Adds examples to install-powershell.ps1 script (#11024) (Thanks @kilasuit!) -- Fix to Select-String emphasis and Import-DscResource in CHANGELOG.md (#10890) -- Remove the stale link from powershell-beginners-guide.md (#10926) -- Merge stable and servicing change logs (#10527) -- Update used .NET version in build docs (#10775) (Thanks @Greg-Smulko!) -- Replace links from MSDN to docs.microsoft.com in powershell-beginners-guide.md (#10778) (Thanks @iSazonov!) -- Fix broken DSC overview link (#10702) -- Update Support_Question.md to link to Stack Overflow as another community resource (#10638) (Thanks @mklement0!) -- Add processor architecture to distribution request template (#10661) -- Add new PowerShell MoL book to learning PowerShell docs (#10602) -- Update README.md and metadata for v6.1.6 and v6.2.3 releases (#10523) -- Fix a typo in README.md (#10465) (Thanks @vedhasp!) -- Add a reference to PSKoans module to Learning Resources documentation (#10369) (Thanks @vexx32!) -- Update README.md and metadata.json for 7.0.0-preview.3 (#10393) From c6b3def4590cf87e9047bab8575ed9171da5fceb Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Fri, 10 Jan 2020 14:05:19 -0800 Subject: [PATCH 5/8] update invoke-dscResource to 7.0 --- .../Invoke-DscResource.md | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md diff --git a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md new file mode 100644 index 000000000000..4e901c431d62 --- /dev/null +++ b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md @@ -0,0 +1,158 @@ +--- +external help file: Microsoft.Windows.DSC.CoreConfProviders.dll-help.xml +keywords: powershell,cmdlet +locale: en-us +Module Name: PSDesiredStateConfiguration +ms.date: 01/10/2020 +online version: https://docs.microsoft.com/powershell/module/psdesiredstateconfiguration/invoke-dscresource?view=powershell-7&WT.mc_id=ps-gethelp +schema: 2.0.0 +title: Invoke-DscResource +--- + +# Invoke-DscResource + +## SYNOPSIS + +Runs a method of a specified PowerShell Desired State Configuration (DSC) resource. + +## SYNTAX + +```powershell +Invoke-DscResource [-Name] [-Method] -ModuleName -Property + [] +``` + +## DESCRIPTION + +The `Invoke-DscResource` cmdlet runs a method of a specified PowerShell Desired State Configuration +(DSC) resource. + +This cmdlet invokes a DSC resource directly, without creating a configuration document. +Using this cmdlet, configuration management products can manage windows or Linux by using DSC resources. +This cmdlet also enables debugging of resources when the DSC engine is running with debugging enabled. + +## EXAMPLES + +### Example 1: Invoke the Set method of a resource by specifying its mandatory properties + +```powershell +PS C:\> Invoke-DscResource -Name Log -Method Set -Property @{Message = 'Hello World'} -ModuleName PSDesiredStateConfiguration +``` + +This command invokes the **Set** method of a resource named Log and specifies a **Message** property +for it. + +### Example 2: Invoke the Test method of a resource for a specified module + +```powershell +PS C:\> Invoke-DscResource -Name WindowsProcess -Method Test -Property @{Path = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'; Arguments = ''} -ModuleName PSDesiredStateConfiguration +``` + +This command invokes the **Test** method of a resource named WindowsProcess, which is in the module +named PSDesiredStateConfiguration. + +## PARAMETERS + +### -Method + +Specifies the method of the resource that this cmdlet invokes. The acceptable values for this +parameter are: **Get**, **Set**, and **Test**. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: +Accepted values: Get, Set, Test + +Required: True +Position: 1 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ModuleName + +Specifies the name of the module from which this cmdlet invokes the specified resource. + +```yaml +Type: ModuleSpecification +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name + +Specifies the name of the DSC resource to start. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Property + +Specifies the resource property name and its value in a hash table as key and value, respectively. + +```yaml +Type: Hashtable +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, +-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, +-WarningAction, and -WarningVariable. For more information, see +[about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Management.Infrastructure.CimInstance, System.Boolean + +## NOTES + +Previously, Windows PowerShell 5.1 resources ran under System context unless specifically specified +with user context using the key **PsDscRunAsCredential**. In PowerShell 7.0, Resources run in the +users context, and **PsDscRunAsCredential** is no longer supported. Previous configurations using +this key will throw an exception. + +## RELATED LINKS + +[Windows PowerShell Desired State Configuration Overview](/powershell/scripting/dsc/overview/dscforengineers) + +[Get-DscConfiguration](Get-DscConfiguration.md) + +[Get-DscConfigurationStatus](Get-DscConfigurationStatus.md) + +[Get-DscResource](Get-DscResource.md) + +[Restore-DscConfiguration](Restore-DscConfiguration.md) + +[Set-DscLocalConfigurationManager](Set-DscLocalConfigurationManager.md) + +[Start-DscConfiguration](Start-DscConfiguration.md) + +[Test-DscConfiguration](Test-DscConfiguration.md) \ No newline at end of file From 8ed6d371d7747c962e4cf976dd11158e79767900 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Fri, 10 Jan 2020 14:11:07 -0800 Subject: [PATCH 6/8] update to invoke-dscresource for 7.0 --- .../Invoke-DscResource.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md index 4e901c431d62..d7de622019ba 100644 --- a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md +++ b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md @@ -35,22 +35,22 @@ This cmdlet also enables debugging of resources when the DSC engine is running w ### Example 1: Invoke the Set method of a resource by specifying its mandatory properties +This command invokes the **Set** method of a resource named Log and specifies a **Message** property +for it. + ```powershell PS C:\> Invoke-DscResource -Name Log -Method Set -Property @{Message = 'Hello World'} -ModuleName PSDesiredStateConfiguration ``` -This command invokes the **Set** method of a resource named Log and specifies a **Message** property -for it. - ### Example 2: Invoke the Test method of a resource for a specified module +This command invokes the **Test** method of a resource named WindowsProcess, which is in the module +named PSDesiredStateConfiguration. + ```powershell PS C:\> Invoke-DscResource -Name WindowsProcess -Method Test -Property @{Path = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'; Arguments = ''} -ModuleName PSDesiredStateConfiguration ``` -This command invokes the **Test** method of a resource named WindowsProcess, which is in the module -named PSDesiredStateConfiguration. - ## PARAMETERS ### -Method @@ -134,9 +134,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES -Previously, Windows PowerShell 5.1 resources ran under System context unless specifically specified +Previously, Windows PowerShell 5.1 resources ran under System context unless specified with user context using the key **PsDscRunAsCredential**. In PowerShell 7.0, Resources run in the -users context, and **PsDscRunAsCredential** is no longer supported. Previous configurations using +user's context, and **PsDscRunAsCredential** is no longer supported. Previous configurations using this key will throw an exception. ## RELATED LINKS From 1781a9785f16a5e1cbe51a0721e2f79fc129bb30 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Fri, 10 Jan 2020 14:46:48 -0800 Subject: [PATCH 7/8] update invoke-dscresource --- .../Invoke-DscResource.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md index d7de622019ba..e4b8ba42151d 100644 --- a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md +++ b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md @@ -12,12 +12,11 @@ title: Invoke-DscResource # Invoke-DscResource ## SYNOPSIS - Runs a method of a specified PowerShell Desired State Configuration (DSC) resource. ## SYNTAX -```powershell +``` Invoke-DscResource [-Name] [-Method] -ModuleName -Property [] ``` @@ -39,7 +38,9 @@ This command invokes the **Set** method of a resource named Log and specifies a for it. ```powershell -PS C:\> Invoke-DscResource -Name Log -Method Set -Property @{Message = 'Hello World'} -ModuleName PSDesiredStateConfiguration +Invoke-DscResource -Name Log -Method Set -ModuleName PSDesiredStateConfiguration -Property @{ + Message = 'Hello World' +} ``` ### Example 2: Invoke the Test method of a resource for a specified module @@ -48,7 +49,14 @@ This command invokes the **Test** method of a resource named WindowsProcess, whi named PSDesiredStateConfiguration. ```powershell -PS C:\> Invoke-DscResource -Name WindowsProcess -Method Test -Property @{Path = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'; Arguments = ''} -ModuleName PSDesiredStateConfiguration +$SplatParam = @{ + Name = 'WindowsProcess' + ModuleName = 'PSDesiredStateConfiguration' + Property = '@{Path = 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'; Arguments = ''}' + Method = Test +} + +Invoke-DscResource @SplatParam ``` ## PARAMETERS From a005980524eaf4a8090dd8088f2c89d756a6fbd4 Mon Sep 17 00:00:00 2001 From: Jason Helmick Date: Fri, 10 Jan 2020 16:12:12 -0800 Subject: [PATCH 8/8] Update reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md Co-Authored-By: Chase Wilson <31453523+chasewilson@users.noreply.github.com> --- .../7.0/PSDesiredStateConfiguration/Invoke-DscResource.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md index e4b8ba42151d..1a3457ef1967 100644 --- a/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md +++ b/reference/7.0/PSDesiredStateConfiguration/Invoke-DscResource.md @@ -46,7 +46,7 @@ Invoke-DscResource -Name Log -Method Set -ModuleName PSDesiredStateConfiguration ### Example 2: Invoke the Test method of a resource for a specified module This command invokes the **Test** method of a resource named WindowsProcess, which is in the module -named PSDesiredStateConfiguration. +named **PSDesiredStateConfiguration**. ```powershell $SplatParam = @{ @@ -163,4 +163,4 @@ this key will throw an exception. [Start-DscConfiguration](Start-DscConfiguration.md) -[Test-DscConfiguration](Test-DscConfiguration.md) \ No newline at end of file +[Test-DscConfiguration](Test-DscConfiguration.md)