diff --git a/content/actions/automating-builds-and-tests/building-and-testing-powershell.md b/content/actions/automating-builds-and-tests/building-and-testing-powershell.md index f00b90f230..e1bc4db7ac 100644 --- a/content/actions/automating-builds-and-tests/building-and-testing-powershell.md +++ b/content/actions/automating-builds-and-tests/building-and-testing-powershell.md @@ -13,7 +13,7 @@ authors: type: tutorial topics: - CI - - Powershell + - PowerShell shortTitle: Build & test PowerShell --- diff --git a/content/actions/learn-github-actions/workflow-commands-for-github-actions.md b/content/actions/learn-github-actions/workflow-commands-for-github-actions.md index f3d0c9c1bd..9020fe9f87 100644 --- a/content/actions/learn-github-actions/workflow-commands-for-github-actions.md +++ b/content/actions/learn-github-actions/workflow-commands-for-github-actions.md @@ -272,13 +272,33 @@ During the execution of a workflow, the runner generates temporary files that ca {% warning %} -**Warning:** Powershell does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path: +**Warning:** On Windows, legacy PowerShell (`shell: powershell`) does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path: ```yaml -steps: - - run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append +jobs: + legacy-powershell-example: + uses: windows-2019 + steps: + - shell: powershell + run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ``` +Or switch to PowerShell Core, which defaults to UTF-8: + +```yaml +jobs: + modern-pwsh-example: + uses: windows-2019 + steps: + - shell: pwsh + run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Append # no need for -Encoding utf8 +``` + +More detail about UTF-8 and PowerShell Core found on this great [Stack Overflow answer](https://stackoverflow.com/a/40098904/162694): + +> ### Optional reading: The cross-platform perspective: PowerShell _Core_: +> [PowerShell is now cross-platform](https://blogs.msdn.microsoft.com/powershell/2016/08/18/powershell-on-linux-and-open-source-2/), via its **[PowerShell _Core_](https://github.com/PowerShell/PowerShell)** edition, whose encoding - sensibly - **defaults to *BOM-less UTF-8***, in line with Unix-like platforms. + {% endwarning %} ## Setting an environment variable diff --git a/content/admin/advanced-security/deploying-github-advanced-security-in-your-enterprise.md b/content/admin/advanced-security/deploying-github-advanced-security-in-your-enterprise.md index 50661b5d2f..86d82736f6 100644 --- a/content/admin/advanced-security/deploying-github-advanced-security-in-your-enterprise.md +++ b/content/admin/advanced-security/deploying-github-advanced-security-in-your-enterprise.md @@ -235,7 +235,7 @@ If you’re using a phased approach to roll out GHAS, we recommend enabling {% d If you’re not planning on a phased rollout approach and want to enable code scanning for many repositories, you may want to script the process. -For an example of a script that opens pull requests to add a {% data variables.product.prodname_actions %} workflow to multiple repositories, see the [`jhutchings1/Create-ActionsPRs`](https://github.com/jhutchings1/Create-ActionsPRs) repository for an example using Powershell, or [`nickliffen/ghas-enablement`](https://github.com/NickLiffen/ghas-enablement) for teams who do not have Powershell and instead would like to use NodeJS. +For an example of a script that opens pull requests to add a {% data variables.product.prodname_actions %} workflow to multiple repositories, see the [`jhutchings1/Create-ActionsPRs`](https://github.com/jhutchings1/Create-ActionsPRs) repository for an example using PowerShell, or [`nickliffen/ghas-enablement`](https://github.com/NickLiffen/ghas-enablement) for teams who do not have PowerShell and instead would like to use NodeJS. ### Step 4: Run code scans and review your results diff --git a/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md b/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md index 733b9b098f..7252e596e2 100644 --- a/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md +++ b/content/authentication/keeping-your-account-and-data-secure/about-anonymized-urls.md @@ -28,7 +28,7 @@ In rare circumstances, images that are processed through Camo might not appear o {% tip %} -Windows users will either need to use the Git Powershell (which is installed alongside [{% data variables.product.prodname_desktop %}](https://desktop.github.com/)) or download [curl for Windows](http://curl.haxx.se/download.html). +Windows users will either need to use the Git PowerShell (which is installed alongside [{% data variables.product.prodname_desktop %}](https://desktop.github.com/)) or download [curl for Windows](http://curl.haxx.se/download.html). {% endtip %} diff --git a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md index f2f2c8ea81..261690a29f 100644 --- a/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md +++ b/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md @@ -60,7 +60,7 @@ In the default {% data variables.product.prodname_codeql_workflow %}, {% data va The `on:pull_request` and `on:push` triggers for code scanning are each useful for different purposes. For more information, see "[Scanning pull requests](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#scanning-pull-requests)" and "[Scanning on push](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#scanning-on-push)." ## Bulk set up of {% data variables.product.prodname_code_scanning %} -You can set up {% data variables.product.prodname_code_scanning %} in many repositories at once using a script. If you'd like to use a script to raise pull requests that add a {% data variables.product.prodname_actions %} workflow to multiple repositories, see the [`jhutchings1/Create-ActionsPRs`](https://github.com/jhutchings1/Create-ActionsPRs) repository for an example using Powershell, or [`nickliffen/ghas-enablement`](https://github.com/NickLiffen/ghas-enablement) for teams who do not have Powershell and instead would like to use NodeJS. +You can set up {% data variables.product.prodname_code_scanning %} in many repositories at once using a script. If you'd like to use a script to raise pull requests that add a {% data variables.product.prodname_actions %} workflow to multiple repositories, see the [`jhutchings1/Create-ActionsPRs`](https://github.com/jhutchings1/Create-ActionsPRs) repository for an example using PowerShell, or [`nickliffen/ghas-enablement`](https://github.com/NickLiffen/ghas-enablement) for teams who do not have PowerShell and instead would like to use NodeJS. ## Viewing the logging output from {% data variables.product.prodname_code_scanning %} diff --git a/data/allowed-topics.js b/data/allowed-topics.js index 6db0611cca..999b6d7a8f 100644 --- a/data/allowed-topics.js +++ b/data/allowed-topics.js @@ -109,7 +109,7 @@ export default [ 'Permissions', 'Policies', 'Policy', - 'Powershell', + 'PowerShell', 'Pre-receive hooks', 'Privacy', 'Profile', diff --git a/data/product-examples/actions/code-examples.yml b/data/product-examples/actions/code-examples.yml index 66265a5d18..01d9b8056f 100644 --- a/data/product-examples/actions/code-examples.yml +++ b/data/product-examples/actions/code-examples.yml @@ -193,7 +193,7 @@ - automation - title: Update Configured GitHub Actions to the Latest Versions description: CLI tool to check whehter all your actions are up-to-date or not - languages: 'C#, Inno Setup, PowerSHell, Shell' + languages: 'C#, Inno Setup, PowerShell, Shell' href: fabasoad/ghacu tags: - versions