Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move $OFS to prefs article added note about read-only #1978

Merged
merged 1 commit into from
Dec 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-11-27
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand All @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell.

## LONG DESCRIPTION

Conceptually, these variables are considered to be read-only.
Even though they **can** be written to, for backward compatibility they **should not** be written to.

Here is a list of the automatic variables in PowerShell:

### $$
Expand Down Expand Up @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting
Appointment on Friday: Team lunch
```

### $OFS

$OFS is a special variable that stores a string that you want to use as an
output field separator. Use this variable when you are converting an array
to a string. By default, the value of $OFS is " ", but you can change the
value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed
elsewhere in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

### $PID

Contains the process identifier (PID) of the process that is hosting the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-12-05
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand Down Expand Up @@ -835,7 +835,45 @@ Valid values: Any string.
Default: Space

By default, the \$OFS variable does not exist and the output file separator is
a space, but you can add this variable and set it to any string.
a space, but you can add this variable and set it to any string. You can change
the value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed elsewhere
in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

##### EXAMPLES

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-11-27
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand All @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell.

## LONG DESCRIPTION

Conceptually, these variables are considered to be read-only.
Even though they **can** be written to, for backward compatibility they **should not** be written to.

Here is a list of the automatic variables in PowerShell:

### $$
Expand Down Expand Up @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting
Appointment on Friday: Team lunch
```

### $OFS

$OFS is a special variable that stores a string that you want to use as an
output field separator. Use this variable when you are converting an array
to a string. By default, the value of $OFS is " ", but you can change the
value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed
elsewhere in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

### $PID

Contains the process identifier (PID) of the process that is hosting the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-12-05
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand Down Expand Up @@ -835,7 +835,45 @@ Valid values: Any string.
Default: Space

By default, the \$OFS variable does not exist and the output file separator is
a space, but you can add this variable and set it to any string.
a space, but you can add this variable and set it to any string. You can change
the value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed elsewhere
in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

##### EXAMPLES

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-11-27
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand All @@ -15,6 +15,9 @@ variables are created and maintained by PowerShell.

## LONG DESCRIPTION

Conceptually, these variables are considered to be read-only.
Even though they **can** be written to, for backward compatibility they **should not** be written to.

Here is a list of the automatic variables in PowerShell:

### $$
Expand Down Expand Up @@ -270,50 +273,6 @@ Appointment on Tuesday: Meeting
Appointment on Friday: Team lunch
```

### $OFS

$OFS is a special variable that stores a string that you want to use as an
output field separator. Use this variable when you are converting an array
to a string. By default, the value of $OFS is " ", but you can change the
value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed
elsewhere in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

### $PID

Contains the process identifier (PID) of the process that is hosting the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
ms.date: 2017-12-05
ms.date: 2017-12-21
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
Expand Down Expand Up @@ -835,7 +835,45 @@ Valid values: Any string.
Default: Space

By default, the \$OFS variable does not exist and the output file separator is
a space, but you can add this variable and set it to any string.
a space, but you can add this variable and set it to any string. You can change
the value of $OFS in your session, by typing `$OFS="<value>"`. If you are
expecting the default value of " " in your script, module, or configuration
output, be careful that the $OFS default value has not been changed elsewhere
in your code.

For example:

```powershell
$a="1","2","3","4"
$a
[string]$a
$OFS=""
[string]$a
$OFS=","
[string]$a
$OFS="--PowerShellRocks--";
[string]$a
$OFS="`n`n";
[string]$a
```

```output
1
2
3
4
1 2 3 4
1234
1,2,3,4
1--PowerShellRocks--2--PowerShellRocks--3--PowerShellRocks--4
1

2

3

4
```

##### EXAMPLES

Expand Down
Loading