Skip to content
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
4 changes: 2 additions & 2 deletions dsc/secureMOF.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ The following example:
1. creates a certificate on the **Authoring node**.
2. exports the certificate including the private key on the **Authoring node**.
3. removes the private key from the **Authoring node**, but keeps the public key certificate in the **my** store.
4. imports the private key certificate into the root certificate store on the **Target node**.
4. imports the private key certificate into the My(Personal) certificate store on the **Target node**.
- it must be added to the root store so that it will be trusted by the **Target node**.

#### On the Authoring Node: create and export the certificate
Expand Down Expand Up @@ -466,4 +466,4 @@ function Get-EncryptionCertificate
}

Start-CredentialEncryptionExample
```
```
64 changes: 64 additions & 0 deletions reference/3.0/Microsoft.PowerShell.Core/About/about_CimSession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
ms.date: 04/28/2018
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
title: about_CimSession
---

# About CimSession

## SHORT DESCRIPTION

Describes a CimSession object and the difference between CIM sessions and
PowerShell sessions.

## LONG DESCRIPTION

A Common Information Model (CIM) session is a client-side object that
represents a connection to a local computer or a remote computer. You can
use CIM sessions as an alternative to PowerShell sessions
(PSSessions). Both approaches have advantages.

You can use the New-CimSession cmdlet to create a CIM session that contains
information about a connection, such as computer name, the protocol used
for the connection, session ID, and instance ID.

After you create a CimSession object that specifies information required to
establish a connection, PowerShell does not establish the
connection immediately. When a cmdlet uses the CIM session,
PowerShell connects to the specified computer, and then, when the
cmdlet finishes, PowerShell terminates the connection.

If you create a PSSession instead of using a CIM session,
PowerShell validates connection settings, and then establishes and
maintains the connection. If you use CIM sessions, PowerShell
does not open a network connection until needed. For more information about
PowerShell sessions, see [about_PSSessions](about_PSSessions.md).

### When to Use a CIM Session

Only cmdlets that work with a Windows Management Instrumentation (WMI)
provider or CIM over WS-Man accept CIM sessions.
For other cmdlets, use PSSessions.

When you use a CIM session, PowerShell runs the cmdlet on the
local client. It connects to the WMI provider by using the CIM session.
The target computer does not require PowerShell, or even any
version of the Windows operating system.

In contrast, a cmdlet run by using a PSSession runs on the target
computer. It requires PowerShell on the target system.
Furthermore, the cmdlet sends data back to the local computer.
PowerShell manages the data sent over the connection, and keeps
the size within the limits set by Windows Remote Management (WinRM). CIM
sessions do not impose the WinRM limits.

CIM-based Cmdlet Definition XML (CDXML) cmdlets can be written to use any
WMI Provider. All WMI providers use CimSession objects.

## SEE ALSO

New-CimSession

[about_PSSessions](about_PSSessions.md)
23 changes: 11 additions & 12 deletions reference/3.0/Microsoft.PowerShell.Core/About/about_Methods.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
---
ms.date: 06/09/2017
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
title: about_Methods
---

# About methods

## SHORT DESCRIPTION
Expand All @@ -30,7 +29,7 @@ To get the methods of any object, use the `Get-Member` cmdlet. Use its
the methods of process objects.

```powershell
PS C:\> Get-Process | Get-Member -MemberType Method
PS> Get-Process | Get-Member -MemberType Method
```

```output
Expand Down Expand Up @@ -68,8 +67,8 @@ takes a delimiter character argument that tells the method where to split the
string.

```powershell
PS C:\> $a = "Try-Catch-Finally"
PS C:\> $a.Split("-")
PS> $a = "Try-Catch-Finally"
PS> $a.Split("-")
Try
Catch
Finally
Expand Down Expand Up @@ -155,15 +154,15 @@ command uses the `Get-Process` command to get all three instance of the Notepad
process and save them in the \$p variable.

```powershell
PS C:\> Notepad; Notepad; Notepad
PS C:\> $p = Get-Process Notepad
PS> Notepad; Notepad; Notepad
PS> $p = Get-Process Notepad
```

The third command uses the Count property of all collections to verify that
there are three processes in the \$p variable.

```powershell
PS C:\> $p.Count
PS> $p.Count
3
```

Expand All @@ -174,18 +173,18 @@ This command works even though a collection of processes does not have a `Kill`
method.

```
PS C:\> $p.Kill()
PS> $p.Kill()
```

The fifth command uses the Get-Process command to confirm that the `Kill`
command worked.

```powershell
PS C:\> Get-Process Notepad
PS> Get-Process Notepad
Get-Process : Cannot find a process with the name "notepad". Verify the proc
ess name and call the cmdlet again.
At line:1 char:12
+ get-process <<<< notepad
+ Get-Process <<<< notepad
+ CategoryInfo : ObjectNotFound: (notepad:String) [Get-Process]
, ProcessCommandException
+ FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShel
Expand All @@ -196,7 +195,7 @@ To perform the same task on PowerShell 2.0, use the `Foreach-Object` cmdlet to
run the method on each object in the collection.

```powershell
PS C:\> $p | Foreach-Object {$_.Kill()}
PS> $p | ForEach-Object {$_.Kill()}
```

## SEE ALSO
Expand Down
26 changes: 13 additions & 13 deletions reference/3.0/Microsoft.PowerShell.Core/About/about_Modules.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
---
ms.date: 11/29/2017
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
title: about_Modules
---

# About Modules

## Short Description
Expand Down Expand Up @@ -43,6 +42,7 @@ gets all commands in all installed modules, even if they are not yet in the
session, so you can find a command and use it without importing.

Any of the following commands will import a module into your session.

### Run the Command

```powershell
Expand Down Expand Up @@ -486,17 +486,17 @@ NOTE: Remote sessions, including sessions that are started by using the
commands are packaged in snap-ins.

The following modules (or snap-ins) are installed with PowerShell.
* Microsoft.PowerShell.Core
* Microsoft.PowerShell.Diagnostics
* Microsoft.PowerShell.Host
* Microsoft.PowerShell.Management
* Microsoft.PowerShell.Security
* Microsoft.PowerShell.Utility
* Microsoft.WSMan.Management
* PSScheduledJob
* PSWorkflow
* PSWorkflowUtility
* ISE
- Microsoft.PowerShell.Core
- Microsoft.PowerShell.Diagnostics
- Microsoft.PowerShell.Host
- Microsoft.PowerShell.Management
- Microsoft.PowerShell.Security
- Microsoft.PowerShell.Utility
- Microsoft.WSMan.Management
- PSScheduledJob
- PSWorkflow
- PSWorkflowUtility
- ISE

## Logging Module Events

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
---
ms.date: 11/30/2017
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
title: about_Object_Creation
---

# About Object Creation

## SHORT DESCRIPTION
Expand Down Expand Up @@ -43,8 +42,8 @@ ProgID of a COM object.
For example, the following command creates a Version object.

```powershell
PS C:\> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1
PS C:\> $v
PS> $v = New-Object -TypeName System.Version -ArgumentList 2.0.0.1
PS> $v
```

```Output
Expand All @@ -54,7 +53,7 @@ Major Minor Build Revision
```

```powershell
PS C:\> $v | Get-Member
PS> $v | Get-Member

TypeName: System.Version
```
Expand Down Expand Up @@ -118,7 +117,7 @@ The output of this function is a collection of custom objects formatted as a
table by default.

```powershell
PS C:\> Test-Object
PS> Test-Object

ModuleName UICulture Version
--------- --------- -------
Expand All @@ -130,7 +129,7 @@ Users can manage the properties of the custom objects just as they do with
standard objects.

```powershell
PS C:\> (Test-Object).ModuleName
PS> (Test-Object).ModuleName
PSScheduledJob
PSWorkflow
```
Expand Down Expand Up @@ -202,8 +201,8 @@ AssetID, Name, OS, Department
```

```powershell
PS C:\> $a = Import-Csv Servers.csv
PS C:\> $a
PS> $a = Import-Csv Servers.csv
PS> $a

AssetID Name OS Department
------- ---- -- ----------
Expand All @@ -215,7 +214,7 @@ AssetID Name OS Department
Use the Get-Member cmdlet to confirm the object type.

```powershell
PS C:\> $a | Get-Member
PS> $a | Get-Member
```

```Output
Expand All @@ -236,7 +235,7 @@ OS NoteProperty System.String OS=Windows Server 2012
You can use the custom objects just as you would standard objects.

```powershell
PS C:\> $a | where {$_.OS -eq "Windows 8"}
PS> $a | Where-Object {$_.OS -eq "Windows 8"}
```

```output
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
---
ms.date: 11/30/2017
schema: 2.0.0
locale: en-us
keywords: powershell,cmdlet
title: about_Objects
---

# About Objects

## Short Description
Expand Down Expand Up @@ -49,7 +48,7 @@ The following example demonstrates how objects are passed from one
command to the next:

```powershell
Get-ChildItem C: | where { $_.PsIsContainer -eq $false } | Format-List
Get-ChildItem C: | Where-Object { $_.PsIsContainer -eq $false } | Format-List
```

The first command `Get-ChildItem C:` returns a file or directory object
Expand Down
Loading