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

Fixes 10796 - Removed invalid parameters #10800

Merged
merged 1 commit into from
Jan 17, 2024
Merged
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
93 changes: 0 additions & 93 deletions reference/7.4/Microsoft.PowerShell.Utility/New-Guid.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,6 @@ Creates a GUID.
New-Guid [<CommonParameters>]
```

### Empty
```
New-Guid [-Empty] [<CommonParameters>]
```

### InputObject
```
New-Guid [-InputObject <String>] [<CommonParameters>]
```

## DESCRIPTION

The `New-Guid` cmdlet creates a random globally unique identifier (GUID). If you need a unique ID in
Expand All @@ -45,87 +35,8 @@ New-Guid
This command creates a random GUID. Alternatively, you could store the output of this cmdlet in a
variable to use elsewhere in a script.

### Example 2: Create an empty GUID

```powershell
New-Guid -Empty
```

```Output
Guid
----
00000000-0000-0000-0000-000000000000
```

### Example 3: Create a GUID from a string

This example converts a string that contains a GUID to a GUID object.

```powershell
New-Guid -InputObject "d61bbeca-0186-48fa-90e1-ff7aa5d33e2d"
```

```Output
Guid
----
d61bbeca-0186-48fa-90e1-ff7aa5d33e2d
```

### Example 4: Convert strings from the pipeline to GUIDs

This examples converts strings from the pipeline to GUID objects.

```powershell
$guidStrings = (
'11c43ee8-b9d3-4e51-b73f-bd9dda66e29c',
'0f8fad5bd9cb469fa16570867728950e',
'{0x01234567, 0x89ab, 0xcdef,{0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef}}'
)
$guidStrings | New-Guid
```

```Output
Guid
----
11c43ee8-b9d3-4e51-b73f-bd9dda66e29c
0f8fad5b-d9cb-469f-a165-70867728950e
01234567-89ab-cdef-0123-456789abcdef
```

## PARAMETERS

### -Empty

Indicates that this cmdlet creates an empty GUID. An empty GUID has all zeros in its string.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: Empty
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -InputObject

This parameter accepts a string representing a GUID and converts it to a GUID object.

```yaml
Type: System.String
Parameter Sets: InputObject
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
Expand All @@ -143,8 +54,4 @@ This cmdlet returns a GUID.

## NOTES

The cmdlet passes string input to the constructor of the **System.Guid** class. The constructor
support strings in several formats. For more information, see
[System.Guid(String)](/dotnet/api/system.guid.-ctor?view=net-7.0#system-guid-ctor(system-string)).

## RELATED LINKS