Skip to content

Commit

Permalink
Markdown and PS Styles (#11697)
Browse files Browse the repository at this point in the history
* PS style and format

* fix reference
  • Loading branch information
ArieHein authored Jan 18, 2025
1 parent 9be6a8c commit 225441e
Show file tree
Hide file tree
Showing 23 changed files with 155 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ different than the source filename stored in the archive.

## RELATED LINKS

[Compress-Archive](compress-archive.md)
[Compress-Archive](Compress-Archive.md)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ title: Microsoft.PowerShell.Archive

## Description

This section contains the help topics for the cmdlets that are installed with the PowerShell Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and extract archive or ZIP files.
This section contains the help topics for the cmdlets that are installed with the PowerShell
Microsoft.PowerShell.Archive module. The Archive module contains cmdlets that let you create and
extract archive or ZIP files.

## Microsoft.PowerShell.Archive Cmdlets

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ The following values of `$env:TERM` change the behavior as follows:

- `dumb` - sets `$Host.UI.SupportsVirtualTerminal = $false`
- `xterm-mono` - sets `$PSStyle.OutputRendering = PlainText`
- `xtermm` - sets `$PSStyle.OutputRendering = PlainText`
- `xterm` - sets `$PSStyle.OutputRendering = PlainText`

If `$env:NO_COLOR` exists, then `$PSStyle.OutputRendering` is set to
**PlainText**. For more information about the **NO_COLOR** environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,27 @@ The aliases have no child items.
The **Alias** provider supports the following cmdlets, which are covered
in this article.

- [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location)
- [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location)
- [Get-Item](xref:Microsoft.PowerShell.Management.Get-Item)
- [New-Item](xref:Microsoft.PowerShell.Management.New-Item)
- [Remove-Item](xref:Microsoft.PowerShell.Management.Remove-Item)
- [Clear-Item](xref:Microsoft.PowerShell.Management.Clear-Item)
- [Get-Location][01]
- [Set-Location][02]
- [Get-Item][03]
- [New-Item][04]
- [Remove-Item][05]
- [Clear-Item][06]

PowerShell includes a set of cmdlets that are designed to view and to change
aliases. When you use **Alias** cmdlets, you do not need to specify the
`Alias:` drive in the name. This article does not cover working with **Alias**
cmdlets.

- [Export-Alias](xref:Microsoft.PowerShell.Utility.Export-Alias)
- [Get-Alias](xref:Microsoft.PowerShell.Utility.Get-Alias)
- [Import-Alias](xref:Microsoft.PowerShell.Utility.Import-Alias)
- [New-Alias](xref:Microsoft.PowerShell.Utility.New-Alias)
- [Set-Alias](xref:Microsoft.PowerShell.Utility.Set-Alias)
- [Export-Alias][07]
- [Get-Alias][08]
- [Import-Alias][09]
- [New-Alias][10]
- [Set-Alias][11]

## Types exposed by this provider

Each alias is an instance of the
[System.Management.Automation.AliasInfo](/dotnet/api/system.management.automation.aliasinfo)
Each alias is an instance of the [System.Management.Automation.AliasInfo][12]
class.

## Navigating the Alias drive
Expand All @@ -87,11 +86,8 @@ path.
> [!NOTE]
> PowerShell uses aliases to allow you a familiar way to work with provider
> paths. Commands such as `dir` and `ls` are now aliases on Windows and `dir`
> on Linux and macOS for [Get-ChildItem](xref:Microsoft.PowerShell.Management.Get-ChildItem),
> `cd` is an alias for
> [Set-Location](xref:Microsoft.PowerShell.Management.Set-Location). and `pwd`
> is an alias for
> [Get-Location](xref:Microsoft.PowerShell.Management.Get-Location).
> on Linux and macOS for [Get-ChildItem][13], `cd` is an alias for
> [Set-Location][02] and `pwd` is an alias for [Get-Location][01].
### Displaying the Contents of the Alias: drive

Expand Down Expand Up @@ -198,7 +194,7 @@ cmdlet. The `-Options` parameter is available in `Set-Item` when you use it
with the **Alias** or **Function** provider.

```powershell
Set-Item -Path Alias:dir -Options "AllScope,ReadOnly"
Set-Item -Path Alias:dir -Options "AllScope, ReadOnly"
```

### Change an aliases referenced command
Expand Down Expand Up @@ -293,8 +289,8 @@ Determines the value of the **Options** property of an alias.

#### Cmdlets supported

- [New-Item](xref:Microsoft.PowerShell.Management.New-Item)
- [Set-Item](xref:Microsoft.PowerShell.Management.Set-Item)
- [New-Item][04]
- [Set-Item][14]

## Using the pipeline

Expand All @@ -309,10 +305,8 @@ Beginning in Windows PowerShell 3.0, you can get customized help topics for
provider cmdlets that explain how those cmdlets behave in a file system drive.

To get the help topics that are customized for the file system drive, run a
[Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) command in a file system
drive or use the `-Path` parameter of
[Get-Help](xref:Microsoft.PowerShell.Core.Get-Help) to specify a file system
drive.
[Get-Help][15] command in a file system drive or use the `-Path` parameter of
[Get-Help][15] to specify a file system drive.

```powershell
Get-Help Get-ChildItem
Expand All @@ -324,5 +318,24 @@ Get-Help Get-ChildItem -Path alias:

## See also

- [about_Aliases](about_Aliases.md)
- [about_Providers](about_Providers.md)
- [about_Aliases][16]
- [about_Providers][17]

<!-- External links -->
[01]: xref:Microsoft.PowerShell.Management.Get-Location
[02]: xref:Microsoft.PowerShell.Management.Set-Location
[03]: xref:Microsoft.PowerShell.Management.Get-Item
[04]: xref:Microsoft.PowerShell.Management.New-Item
[05]: xref:Microsoft.PowerShell.Management.Remove-Item
[06]: xref:Microsoft.PowerShell.Management.Clear-Item
[07]: xref:Microsoft.PowerShell.Utility.Export-Alias
[08]: xref:Microsoft.PowerShell.Utility.Get-Alias
[09]: xref:Microsoft.PowerShell.Utility.Import-Alias
[10]: xref:Microsoft.PowerShell.Utility.New-Alias
[11]: xref:Microsoft.PowerShell.Utility.Set-Alias
[12]: /dotnet/api/system.management.automation.aliasinfo
[13]: xref:Microsoft.PowerShell.Management.Get-ChildItem
[14]: xref:Microsoft.PowerShell.Management.Set-Item
[15]: xref:Microsoft.PowerShell.Core.Get-Help
[16]: about_Aliases.md
[17]: about_Providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ in the current session, type:
Get-Alias
```

To get particular aliases, use the Name parameter of the `Get-Alias` cmdlet. For
example, to get aliases that begin with "p", type:
To get particular aliases, use the Name parameter of the `Get-Alias` cmdlet.
For example, to get aliases that begin with "p", type:

```powershell
Get-Alias -Name p*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ result without losing precision. For example:
(2 + 3.1).GetType().FullName
```

```output
```Output
5.1
System.Int32
System.Double
Expand All @@ -217,7 +217,7 @@ is widened to accommodate the result, as in the following example:
(512MB * 512MB).GetType().FullName
```

```output
```Output
System.Int32
System.Double
```
Expand All @@ -230,7 +230,7 @@ the unsigned integer is too large to be cast to `Int32`:
([int32]::minvalue + [uint32]::maxvalue).GetType().FullName
```

```output
```Output
System.Int64
```

Expand Down Expand Up @@ -269,8 +269,8 @@ PS> [ulong](9223372036854775807 + 2)
9223372036854775808
```

Defining the larger value as `[ulong]` first avoids the problem and produces the
correct result.
Defining the larger value as `[ulong]` first avoids the problem and produces
the correct result.

```powershell
PS> 9223372036854775807ul + 2
Expand Down Expand Up @@ -327,7 +327,7 @@ $b = "A","B","C"
$a + $b
```

```output
```Output
1
2
3
Expand Down Expand Up @@ -390,7 +390,7 @@ $hash2 = @{c1="Server01"; c2="Server02"}
$hash1 + $hash2
```

```output
```Output
Name Value
---- -----
c2 Server02
Expand All @@ -409,7 +409,7 @@ $hash2 = @{c1="Server01"; c="Server02"}
$hash1 + $hash2
```

```output
```Output
OperationStopped:
Line |
3 | $hash1 + $hash2
Expand All @@ -427,7 +427,7 @@ $array2 = $array1 + $hash1
$array2
```

```output
```Output
0
Hello World
Expand All @@ -448,7 +448,7 @@ However, you can't add any other type to a hash table.
$hash1 + 2
```

```output
```Output
InvalidOperation: A hash table can only be added to another hash table.
```

Expand All @@ -463,7 +463,7 @@ $array = @()
$array
```

```output
```Output
0
1
2
Expand Down Expand Up @@ -508,7 +508,7 @@ results are then added using the `+` operator.
Get-Process | Where-Object { ($_.ws * 2) -gt 50mb }
```

```output
```Output
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
1896 39 50968 30620 264 1,572.55 1104 explorer
Expand Down
7 changes: 3 additions & 4 deletions reference/7.5/Microsoft.PowerShell.Core/About/about_Arrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -639,8 +639,8 @@ The value of `mode` must be a [WhereOperatorSelectionMode][02] enum value:
- `Default` (`0`) - Return all items
- `First` (`1`) - Return the first item
- `Last` (`2`) - Return the last item
- `SkipUntil` (`3`) - Skip items until condition is true, return all the remaining
items (including the first item for which the condition is true)
- `SkipUntil` (`3`) - Skip items until condition is true, return all the
remaining items (including the first item for which the condition is true)
- `Until` (`4`) - Return all items until condition is true
- `Split` (`5`) - Return an array of two elements
- The first element contains matching items
Expand Down Expand Up @@ -1018,8 +1018,7 @@ PS> [Collections.Generic.Dictionary[string, int]]::new()['nosuchkey']
# No output ($null)
PS> [Collections.Generic.Dictionary[string, int]]::new().Item('nosuchkey')
GetValueInvocationException: Exception getting "Item": "The given key 'nosuchkey'
was not present in the dictionary."
GetValueInvocationException: Exception getting "Item": "The given key 'nosuchkey' was not present in the dictionary."
```

## Member-access enumeration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ $a += 2
$a
```

```
```Output
6
```

Expand Down Expand Up @@ -646,8 +646,7 @@ $x
100
```

For more information, see
[Null-coalescing operator][04].
For more information, see [Null-coalescing operator][04].

## Microsoft .NET types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ online version: https://learn.microsoft.com/powershell/module/microsoft.powershe
schema: 2.0.0
title: about_Automatic_Variables
---

# about_Automatic_Variables

## Short description
Expand Down Expand Up @@ -422,7 +421,7 @@ the objects.

```powershell
$a = "one", $null, "three"
$a.count
$a.Count
```

```Output
Expand All @@ -433,7 +432,7 @@ If you pipe the `$null` variable to the `ForEach-Object` cmdlet, it generates a
value for `$null`, just as it does for the other objects

```powershell
"one", $null, "three" | ForEach-Object { "Hello " + $_}
"one", $null, "three" | ForEach-Object {"Hello " + $_}
```

```Output
Expand All @@ -451,8 +450,8 @@ were ignored.

```powershell
$calendar = @($null, $null, "Meeting", $null, $null, "Team Lunch", $null)
$days = "Sunday","Monday","Tuesday","Wednesday","Thursday",
"Friday","Saturday"
$days = "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"
$currentDay = 0
foreach($day in $calendar)
{
Expand Down Expand Up @@ -744,10 +743,9 @@ isn't considered best practice.

### MoveNext

The [MoveNext][76] method
advances the enumerator to the next element of the collection. **MoveNext**
returns `True` if the enumerator was successfully advanced, `False` if the
enumerator has passed the end of the collection.
The [MoveNext][76] method advances the enumerator to the next element of the
collection. **MoveNext** returns `True` if the enumerator was successfully
advanced, `False` if the enumerator has passed the end of the collection.

> [!NOTE]
> The **Boolean** value returned by **MoveNext** is sent to the output stream.
Expand Down
7 changes: 4 additions & 3 deletions reference/7.5/Microsoft.PowerShell.Core/About/about_Break.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ even pass control across script and function call boundaries.

## Using `break` in a `switch` statement

In a `switch`construct, `break` causes PowerShell to exit the `switch` code block.
In a `switch`construct, `break` causes PowerShell to exit the `switch` code
block.

The `break` keyword is used to leave the `switch` construct. For example, the
following `switch` statement uses `break` statements to test for the most
Expand Down Expand Up @@ -190,8 +191,8 @@ function test {
test
```

Notice that execution stops at the exception. The `After loop` is never reached.
The exception is re-thrown after the `trap` executes.
Notice that execution stops at the exception. The `After loop` is never
reached. The exception is re-thrown after the `trap` executes.

```Output
Before loop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ This function clears the screen. For more information, see

## `TabExpansion2`

This is the default function to use for tab expansion. For more information, see
[TabExpansion2](xref:Microsoft.PowerShell.Core.TabExpansion2).
This is the default function to use for tab expansion. For more information,
see [TabExpansion2](xref:Microsoft.PowerShell.Core.TabExpansion2).

## `oss`

Expand Down
Loading

0 comments on commit 225441e

Please sign in to comment.