Today's cmdlet ‣ ConvertFrom-StringData
Converts a string containing one or more key and value pairs to a hash table.
Example's Remarks:
• Because the text includes variable names, it must be enclosed in a single-quoted string so that the variables are interpreted literally and not expanded.
• Variables are not permitted in the DATA section.
#tutorial
Converts a string containing one or more key and value pairs to a hash table.
Example's Remarks:
• Because the text includes variable names, it must be enclosed in a single-quoted string so that the variables are interpreted literally and not expanded.
• Variables are not permitted in the DATA section.
#tutorial
👍1
Today's cmdlet ‣ Split-Path
Returns the specified part of a path.
Example's Remarks:
• This command changes your location to the folder that contains the PowerShell profile.
#tutorial
Returns the specified part of a path.
Example's Remarks:
• This command changes your location to the folder that contains the PowerShell profile.
#tutorial
❤1
Today's cmdlet ‣ Export-PSSession
Exports commands from another session and saves them in a PowerShell module.
Example's Remarks:
• The `New-PSSession` command creates a PSSession on the Server01 computer and saves it in the `$S` variable.
• The `Export-PSSession` command exports the cmdlets whose names begin with Test from the PSSession in `$S` to the TestCmdlets module on the local computer.
#tutorial
Exports commands from another session and saves them in a PowerShell module.
Example's Remarks:
• The `New-PSSession` command creates a PSSession on the Server01 computer and saves it in the `$S` variable.
• The `Export-PSSession` command exports the cmdlets whose names begin with Test from the PSSession in `$S` to the TestCmdlets module on the local computer.
#tutorial
Today's cmdlet ‣ Resume-Service
Resumes one or more suspended (paused) services.
Example's Remarks:
• This command resumes all of the suspended services on the computer.
• The `Get-Service` cmdlet command gets all of the services on the computer.
• The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the services that have a Status property of Paused.
• The next pipeline operator sends the results to `Resume-Service`, which resumes the paused services.
#tutorial
Resumes one or more suspended (paused) services.
Example's Remarks:
• This command resumes all of the suspended services on the computer.
• The `Get-Service` cmdlet command gets all of the services on the computer.
• The pipeline operator (`|`) passes the results to the `Where-Object` cmdlet, which selects the services that have a Status property of Paused.
• The next pipeline operator sends the results to `Resume-Service`, which resumes the paused services.
#tutorial
👍1
Today's cmdlet ‣ Debug-Process
Debugs one or more processes running on the local computer.
Example's Remarks:
• This command attaches a debugger to all processes that have names that begin with SQL.
#tutorial
Debugs one or more processes running on the local computer.
Example's Remarks:
• This command attaches a debugger to all processes that have names that begin with SQL.
#tutorial
Today's cmdlet ‣ Remove-ItemProperty
Deletes the property and its value from an item.
Example's Remarks:
• The command uses the `Get-Item` cmdlet to get an item that represents the registry key.
• It uses a pipeline operator (`|`) to send the object to `Remove-ItemProperty`.
• Then, it uses the Name parameter of `Remove-ItemProperty` to specify the name of the registry value.
#tutorial
Deletes the property and its value from an item.
Example's Remarks:
• The command uses the `Get-Item` cmdlet to get an item that represents the registry key.
• It uses a pipeline operator (`|`) to send the object to `Remove-ItemProperty`.
• Then, it uses the Name parameter of `Remove-ItemProperty` to specify the name of the registry value.
#tutorial
Today's cmdlet ‣ Push-Location
Adds the current location to the top of a location stack.
Example's Remarks:
• You can use the Location cmdlets in any PowerShell drive (PSDrive).
#tutorial
Adds the current location to the top of a location stack.
Example's Remarks:
• You can use the Location cmdlets in any PowerShell drive (PSDrive).
#tutorial
👌1
Today's cmdlet ‣ Get-Process
Gets the processes that are running on the local computer.
Example's Remarks:
• This command gets all the processes that have a main window title, and it displays them in a table with the process ID and the process name.
#tutorial
Gets the processes that are running on the local computer.
Example's Remarks:
• This command gets all the processes that have a main window title, and it displays them in a table with the process ID and the process name.
#tutorial
Today's cmdlet ‣ Get-ChildItem
Gets the items and child items in one or more specified locations.
Example's Remarks:
• The `Get-ChildItem` cmdlet uses the Path parameter to specify `C:\Test\ .txt`.
• Path * uses the asterisk (` `) wildcard to specify all files with the filename extension `.txt`.
• The Recurse * parameter searches the Path directory its subdirectories, as shown in the Directory: headings.
• The Force parameter displays hidden files such as `hiddenfile.txt` that have a mode of h .
#tutorial
Gets the items and child items in one or more specified locations.
Example's Remarks:
• The `Get-ChildItem` cmdlet uses the Path parameter to specify `C:\Test\ .txt`.
• Path * uses the asterisk (` `) wildcard to specify all files with the filename extension `.txt`.
• The Recurse * parameter searches the Path directory its subdirectories, as shown in the Directory: headings.
• The Force parameter displays hidden files such as `hiddenfile.txt` that have a mode of h .
#tutorial
Today's cmdlet ‣ Pop-Location
Changes the current location to the location most recently pushed onto the stack.
Example's Remarks:
• This command changes your location to the location most recently added to the current stack.
#tutorial
Changes the current location to the location most recently pushed onto the stack.
Example's Remarks:
• This command changes your location to the location most recently added to the current stack.
#tutorial
Today's cmdlet ‣ ConvertTo-Html
Converts .NET objects into HTML that can be displayed in a Web browser.
Example's Remarks:
• This command creates an HTML page of the service objects that the `Get-Service` cmdlet returns.
• The command uses the As parameter to specify a list format.
• The cmdlet `Out-File` sends the resulting HTML to the `Services.htm` file.
#tutorial
Converts .NET objects into HTML that can be displayed in a Web browser.
Example's Remarks:
• This command creates an HTML page of the service objects that the `Get-Service` cmdlet returns.
• The command uses the As parameter to specify a list format.
• The cmdlet `Out-File` sends the resulting HTML to the `Services.htm` file.
#tutorial
Today's cmdlet ‣ Get-Service
Gets the services on the computer.
Example's Remarks:
• The `Get-Service` cmdlet gets all the services on the computer and sends the objects down the pipeline.
• The `Where-Object` cmdlet selects the services whose DependentServices property isn't null.
#tutorial
Gets the services on the computer.
Example's Remarks:
• The `Get-Service` cmdlet gets all the services on the computer and sends the objects down the pipeline.
• The `Where-Object` cmdlet selects the services whose DependentServices property isn't null.
#tutorial
Today's cmdlet ‣ Resume-Service
Resumes one or more suspended (paused) services.
Example's Remarks:
• This command resumes the System Event Notification service on the local computer.
• The service name is represented in the command by sens.
• The command uses the Name parameter to specify the service name of the service, but the command omits the parameter name because the parameter name is optional.
#tutorial
Resumes one or more suspended (paused) services.
Example's Remarks:
• This command resumes the System Event Notification service on the local computer.
• The service name is represented in the command by sens.
• The command uses the Name parameter to specify the service name of the service, but the command omits the parameter name because the parameter name is optional.
#tutorial
Today's cmdlet ‣ Get-PSProvider
Gets information about the specified PowerShell provider.
Example's Remarks:
• These commands find the PowerShell snap-ins or modules that added providers to your session.
• All PowerShell elements, including providers, originate in a snap-in or in a module.
#tutorial
Gets information about the specified PowerShell provider.
Example's Remarks:
• These commands find the PowerShell snap-ins or modules that added providers to your session.
• All PowerShell elements, including providers, originate in a snap-in or in a module.
#tutorial
👍1
Today's cmdlet ‣ Stop-Service
Stops one or more running services.
Example's Remarks:
• This example stops the IISAdmin service on the local computer.
• Because stopping this service also stops the services that depend on the IISAdmin service, it is best to precede `Stop-Service` with a command that lists the services that depend on the IISAdmin service.
#tutorial
Stops one or more running services.
Example's Remarks:
• This example stops the IISAdmin service on the local computer.
• Because stopping this service also stops the services that depend on the IISAdmin service, it is best to precede `Stop-Service` with a command that lists the services that depend on the IISAdmin service.
#tutorial