Files
powershell/content/labs/Lab-One.md
2022-04-19 16:48:33 -05:00

1.5 KiB

+++ title = "Lab One" summary = "My answers for Lab One" date = "04/19/2022" +++

  1. ConvertTo-Html

  2. Out-File for redirecting output into a file. Use the Pipe operator or the InputObject parameter for the input. Out-Printer is exactly the same as above, but is used for outputting to a printer.

  3. 5 Cmdlets are available.

    Get-Command -Noun Process will show you these processes.

    To get the specific number, (Get-Command -Noun Process).Count is available, revealing 5 Process handling Cmdlets.

  4. Write-EventLog

  5. 5 commands are available.

    • Export-Alias
    • Get-Alias
    • Import-Alias
    • New-Alias
    • Set-Alias
  6. Start-Transcript and Stop-Transcript

  7. The -Newest parameter.

  8. The Get-Service Cmdlet lets one retrieve a list of services and access remote computers via the -ComputerName parameter.

  9. The Get-Process Cmdlet lets one retrieve a list of running processes on computers, including remote computers via the -ComputerName parameter.

  10. The -Width parameter lets one resize it.

  11. The -NoClobber parameter ensures that the Out-File Cmdlet will not overwrite any existing files.

  12. The Get-Alias command.

  13. ps -C Server1 is the shortest possible, using the ps alias and the -ComputerName parameter, which at shortest uses only 2 characters; the hyphen and the first character in the parameter's name, C.

  14. This can be counted quickly via (gcm -Noun Object).Count which yields 9.

  15. The about_Arrays topic, accessible via help about_Arrays.