You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/4.0/ISE/Import-IseSnippet.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,14 +37,14 @@ To view and use the imported snippets, from the Windows PowerShell ISEEdit menu,
37
37
Imported snippets are available only in the current session.
38
38
To import the snippets into all Windows PowerShell ISE sessions, add an **Import-IseSnippet** command to your Windows PowerShell profile or copy the snippet files to your local snippets directory ($home\Documents\WindowsPowershell\Snippets).
39
39
40
-
To be imported, the snippets must be properly formatted in the snippet XML for Windows PowerShell ISE snippets and saved in Snippet.ps1xml files.
40
+
To import snippets, they must be properly formatted in the snippet XML for Windows PowerShell ISE snippets and saved in Snippet.ps1xml files.
41
41
To create eligible snippets, use the New-IseSnippet cmdlet.
42
42
New-IseSnippet creates a \<SnippetTitle\>.Snippets.ps1xml file in the $home\Documents\WindowsPowerShell\Snippets directory.
43
43
You can move or copy the snippets to the Snippets directory of a Windows PowerShell module, or to any other directory.
44
44
45
-
NOTE: The Get-IseSnippet cmdlet, which gets user-created snippets in the local snippets directory, does not get imported snippets.
45
+
The Get-IseSnippet cmdlet, which gets user-created snippets in the local snippets directory, does not get imported snippets.
46
46
47
-
This cmdlet is introduced in Windows PowerShell 3.0.
47
+
This cmdlet was introduced in Windows PowerShell 3.0.
48
48
49
49
## EXAMPLES
50
50
@@ -198,4 +198,6 @@ This cmdlet does not generate output.
Copy file name to clipboardExpand all lines: reference/4.0/ISE/New-IseSnippet.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,17 +34,15 @@ To see snippets in Windows PowerShell ISE, from the **Edit** menu, select **Sta
34
34
The **New-ISESnippet** cmdlet creates a \<Title\>.Snippets.ps1xml file in the $home\Documents\WindowsPowerShell\Snippets directory with the title that you specify.
35
35
To include a snippet file in a module that you are authoring, add the snippet file to a Snippets subdirectory of your module directory.
36
36
37
-
Note: You cannot use user-created snippets in a session in which the execution policy is AllSigned or Restricted.
38
-
For more information, see the Notes section.
37
+
You cannot use user-created snippets in a session in which the execution policy is **Restricted** or **AllSigned**.
39
38
40
-
This cmdlet is introduced in Windows PowerShell 3.0.
39
+
This cmdlet was introduced in Windows PowerShell 3.0.
41
40
42
41
## EXAMPLES
43
42
44
-
### Example 1
45
-
46
-
```powershell
47
-
New-IseSnippet -Title Comment-BasedHelp -Description "A template for comment-based help." -Text "<#
43
+
### Example 1: Create a Comment-BasedHelp snippet
44
+
```
45
+
PS C:\> New-IseSnippet -Title Comment-BasedHelp -Description "A template for comment-based help." -Text "<#
48
46
.SYNOPSIS
49
47
.DESCRIPTION
50
48
.PARAMETER <Parameter-Name>
@@ -58,34 +56,33 @@ New-IseSnippet -Title Comment-BasedHelp -Description "A template for comment-bas
58
56
This command creates a Comment-BasedHelp snippet for Windows PowerShell ISE.
59
57
It creates a file named "Comment-BasedHelp.snippets.ps1xml" in the user's Snippets directory ($home\Documents\WindowsPowerShell\Snippets).
60
58
61
-
### Example 2
62
-
63
-
```powershell
64
-
$m = @'
59
+
### Example 2: Create a mandatory snippet
60
+
```
61
+
PS C:\> $M = @'
65
62
Param
66
63
(
67
64
[parameter(Mandatory=$true)]
68
65
[String[]]
69
66
$<ParameterName>
70
67
)
71
68
'@
72
-
New-IseSnippet -Text $m -Title Mandatory -Description "Adds a mandatory function parameter." -Author "Kim Akers, Fabrikam Corp." -Force
69
+
70
+
PS C:\> New-ISESnippet -Text $M -Title Mandatory -Description "Adds a mandatory function parameter." -Author "Patti Fuller, Fabrikam Corp." -Force
73
71
```
74
72
75
-
These commands create a Mandatory snippet for Windows PowerShell ISE.
76
-
The first command saves the snippet text in the $m variable.
73
+
This example creates a Mandatory snippet for Windows PowerShell ISE.
74
+
The first command saves the snippet text in the $M variable.
77
75
The second command uses the **New-ISESnippet** cmdlet to create the snippet.
78
76
The command uses the **Force** parameter to overwrite a previous snippet with the same name.
This command uses the Copy-Item cmdlet to copy the Mandatory snippet from the folder where **New-ISESnippet** places it to the Server\Share file share.
87
84
88
-
Because the Snippets.ps1xml files that **New-ISESnippet** creates are text (XML) files, you can use the Item cmdlets to get, changes, move, rename, and copy them.
85
+
Because the Snippets.ps1xml files that **New-ISESnippet** creates are text (XML) files, you can use the **Item** cmdlets to get, changes, move, rename, and copy them.
Copy file name to clipboardExpand all lines: reference/4.0/Microsoft.PowerShell.Core/Enable-PSRemoting.md
+13-11Lines changed: 13 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,30 +48,32 @@ The **Enable-PSRemoting** cmdlet performs the following operations:
48
48
49
49
To run this cmdlet, start Windows PowerShell with the "Run as administrator" option.
50
50
51
-
CAUTION: On systems that have both Windows PowerShell 3.0 and the Windows PowerShell 2.0 engine, do not use Windows PowerShell 2.0 to run the **Enable-PSRemoting** and Disable-PSRemoting cmdlets.
52
-
The commands might appear to succeed, but the remoting is not configured correctly.
53
-
Remote commands, and later attempts to enable and disable remoting, are likely to fail.
51
+
> [!CAUTION]
52
+
> On systems that have both Windows PowerShell 3.0 and the Windows PowerShell 2.0 engine, do not use
53
+
> Windows PowerShell 2.0 to run the **Enable-PSRemoting** and Disable-PSRemoting cmdlets. The commands
54
+
> might appear to succeed, but the remoting is not configured correctly. Remote commands, and later
55
+
> attempts to enable and disable remoting, are likely to fail.
54
56
55
57
## EXAMPLES
56
58
57
-
### Example 1
59
+
### Example 1: Configure a computer to receive remote commands
58
60
59
61
```powershell
60
62
Enable-PSRemoting
61
63
```
62
64
63
65
This command configures the computer to receive remote commands.
64
66
65
-
### Example 2
67
+
### Example 2: Configure a computer to receive remote commands without a confirmation prompt
66
68
67
69
```powershell
68
70
Enable-PSRemoting -Force
69
71
```
70
72
71
73
This command configures the computer to receive remote commands.
72
-
It uses the Force parameter to suppress the user prompts.
74
+
It uses the *Force* parameter to suppress the user prompts.
73
75
74
-
### Example 3
76
+
### Example 3: Allow remote access on clients
75
77
76
78
```powershell
77
79
Enable-PSRemoting -SkipNetworkProfileCheck -Force
@@ -90,7 +92,8 @@ The command uses the Force parameter to suppress confirmation messages.
90
92
The **SkipNetworkProfileCheck** parameter has no effect on server version of Windows, which allow remote access from public networks in the same local subnet by default.
91
93
92
94
The second command eliminates the subnet restriction.
93
-
The command uses the **Set-NetFirewallRule** cmdlet in the **NetSecurity** module to add a firewall rule that allows remote access from public networks from any remote location, including locations in different subnets.
95
+
The command uses the **Set-NetFirewallRule** cmdlet in the **NetSecurity** module to add a firewall rule that allows remote access from public networks from any remote location.
96
+
This includes locations in different subnets.
94
97
95
98
## PARAMETERS
96
99
@@ -136,9 +139,8 @@ This parameter has no effect on server versions of Windows, which, by default, h
136
139
If the local subnet firewall rule is disabled on a server version of Windows, **Enable-PSRemoting** re-enables it, regardless of the value of this parameter.
137
140
138
141
To remove the local subnet restriction and enable remote access from all locations on public networks, use the **Set-NetFirewallRule** cmdlet in the **NetSecurity** module.
139
-
For more information, see Notes and Examples.
140
142
141
-
This parameter is introduced in Windows PowerShell 3.0.
143
+
This parameter was introduced in Windows PowerShell 3.0.
142
144
143
145
```yaml
144
146
Type: SwitchParameter
@@ -183,7 +185,7 @@ You cannot pipe input to this cmdlet.
183
185
184
186
### System.String
185
187
186
-
Enable-PSRemoting returns strings that describe its results.
188
+
This cmdlet returns strings that describe its results.
The default value is the resource URI of the Module Discovery WMI provider on the remote computer.
374
374
375
-
Use this parameter to get CIM modules from computers and devices that are not running a Windows operating system.
375
+
Use this parameter to get CIM modules from computers and devices that are not running the Windows operating system.
376
376
377
-
This parameter is introduced in Windows PowerShell 3.0.
377
+
This parameter was introduced in Windows PowerShell 3.0.
378
378
379
379
```yaml
380
380
Type: Uri
@@ -394,9 +394,9 @@ Specifies a CIM session on the remote computer.
394
394
Enter a variable that contains the CIM session or a command that gets the CIM session, such as a [Get-CimSession](https://docs.microsoft.com/powershell/module/cimcmdlets/get-cimsession) command.
395
395
396
396
`Get-Module` uses the CIM session connection to get modules from the remote computer.
397
-
When you import the module (by using the `Import-Module` cmdlet) and use the commands from the imported module in the current session, the commands actually run on the remote computer.
397
+
When you import the module by using the `Import-Module` cmdlet and use the commands from the imported module in the current session, the commands actually run on the remote computer.
398
398
399
-
You can use this parameter to get modules from computers and devices that are not running a Windows operating system, and Windows computers that have Windows PowerShell, but do not have Windows PowerShell remoting enabled.
399
+
You can use this parameter to get modules from computers and devices that are not running the Windows operating system, and computers that have Windows PowerShell, but do not have Windows PowerShell remoting enabled.
400
400
401
401
The **CimSession** parameter gets all modules in the **CIMSession**.
402
402
However, you can import only CIM-based and Cmdlet Definition XML (CDXML)-based modules.
Gets modules with names that are specified in the form of **ModuleSpecification** objects (described in the Remarks section of [ModuleSpecification Constructor (Hashtable)](https://msdn.microsoft.com/library/jj136290) in the MSDN library).
418
+
Specifies names of modules in the form of **ModuleSpecification** objects.
419
+
These objects are described in the Remarks section of [ModuleSpecification Constructor (Hashtable)](https://msdn.microsoft.com/library/jj136290) in the MSDN library.
419
420
For example, the **FullyQualifiedName** parameter accepts a module name that is specified in the following formats:
Gets only modules with the specified names or name patterns.
474
-
Wildcards are permitted.
474
+
Specifies names or name patterns of modules that this cmdlet gets.
475
+
Wildcard characters are permitted.
475
476
You can also pipe the names to `Get-Module`.
476
-
You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter; the two parameters are mutually exclusive.
477
+
You cannot specify the **FullyQualifiedName** parameter in the same command as a **Name** parameter.
477
478
478
-
The **Name** parameter cannot accept a module GUID as a value; to return modules by specifying a GUID, use the **FullyQualifiedName** parameter instead of the **Name** parameter.
479
+
**Name** cannot accept a module GUID as a value.
480
+
To return modules by specifying a GUID, use **FullyQualifiedName** instead.
479
481
480
482
```yaml
481
483
Type: String[]
@@ -484,7 +486,7 @@ Aliases:
484
486
485
487
Required: False
486
488
Position: 0
487
-
Default value: All imported or available modules.
489
+
Default value: None
488
490
Accept pipeline input: True (ByValue)
489
491
Accept wildcard characters: False
490
492
```
@@ -498,7 +500,7 @@ When the session is connected to a remote computer, the **ListAvailable** parame
498
500
499
501
A `Get-Module` command with the **PSSession** parameter is equivalent to using the `Invoke-Command` cmdlet to run a `Get-Module -ListAvailable` command in a **PSSession**.
500
502
501
-
This parameter is introduced in Windows PowerShell 3.0.
503
+
This parameter was introduced in Windows PowerShell 3.0.
502
504
503
505
```yaml
504
506
Type: PSSession
@@ -522,7 +524,7 @@ This parameter is designed for development and testing scenarios in which the co
522
524
523
525
When the **Refresh** parameter is used in a command, the **ListAvailable** parameter is required.
524
526
525
-
This parameter is introduced in Windows PowerShell 3.0.
527
+
This parameter was introduced in Windows PowerShell 3.0.
526
528
527
529
```yaml
528
530
Type: SwitchParameter
@@ -544,14 +546,14 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
544
546
545
547
### System.String
546
548
547
-
You can pipe module names to `Get-Module`.
549
+
You can pipe module names to this cmdlet.
548
550
549
551
## OUTPUTS
550
552
551
553
### System.Management.Automation.PSModuleInfo
552
554
553
-
`Get-Module`returns objects that represent modules.
554
-
When you use the **ListAvailable** parameter, `Get-Module` returns a **ModuleInfoGrouping** object, which is a type of **PSModuleInfo** object that has the same properties and methods.
555
+
This cmdlet returns objects that represent modules.
556
+
When you specify the **ListAvailable** parameter, `Get-Module` returns a **ModuleInfoGrouping** object, which is a type of **PSModuleInfo** object that has the same properties and methods.
555
557
556
558
## NOTES
557
559
@@ -568,9 +570,10 @@ When you use the **ListAvailable** parameter, `Get-Module` returns a **ModuleInf
568
570
569
571
- To use the CIM session feature, the remote computer must have WS-Management remoting and Windows Management Instrumentation (WMI), which is the Microsoft implementation of the Common Information Model (CIM) standard. The computer must also have the Module Discovery WMI provider or an alternate WMI provider that has the same basic features.
570
572
571
-
You can use the CIM session feature on computers that are not running a Windows operating system and on Windows computers that have Windows PowerShell, but do not have Windows PowerShell remoting enabled.
573
+
You can use the CIM session feature on computers that are not running the Windows operating system and on Windows computers that have Windows PowerShell, but do not have Windows PowerShell remoting enabled.
572
574
573
-
You can also use the CIM parameters to get CIM modules from computers that have Windows PowerShell remoting enabled, including the local computer.
575
+
You can also use the CIM parameters to get CIM modules from computers that have Windows PowerShell remoting enabled.
576
+
This includes the local computer.
574
577
When you create a CIM session on the local computer, Windows PowerShell uses DCOM, instead of WMI, to create the session.
0 commit comments