external help file | Module Name | online version | schema |
---|---|---|---|
PSRemoteOperations-help.xml |
PSRemoteOperations |
2.0.0 |
Parse the contents of a PSRemoteOperation archive file.
Get-PSRemoteOperationResult [-Computername <String>] [[-ArchivePath] <String>] [-Newest <Int32>] [<CommonParameters>]
Get-PSRemoteOperationResult [-Computername <String>] [[-ArchivePath] <String>] [-Newest <Int32>] [-Raw] [<CommonParameters>]
This command will parse the archived PSRemoteOperation file. It will default to the archive path specified by $PSRemoteOpArchive if it has been defined. The default behavior is to process all files but you can limit the search by computer name.
Use the -Raw parameter to display the contents of the psd1 file. This is especially useful when you get an error that the file can't be parsed as a PowerShell data file.
PS C:\> Get-PSOperationResult -computername Think51
Computername : think51
Date : 09/18/2020 17:19:35 UTC
Scriptblock :
Filepath : C:\scripts\SystemReport.ps1
ArgumentList :
Completed : True
Error :
Get the result for computer THINK51 using the user-defined $PSRemoteOpArchive variable as the path.
PS C:\> Get-PSRemoteOperation -newest 1 -raw
@{
CreatedOn = 'Desk320'
CreatedBy = 'Desk320\jeff'
CreatedAt = '08/06/2019 14:02:59 UTC'
Computername = 'SRV2'
ArgumentList = @{
verbose = '$true'
Name = 'bits'
}
Scriptblock = 'param([string]$Name)
get-service $name | export-clixml "c:\scripts\$name.xml"
'
Completed = 'True'
Error = ""
Date = '08/06/2019 14:04:04 UTC'
}
Display the contents of the data file for the last operation.
Enter the path to the archive folder. This will default to the global variable PSRemoteOPArchive if it has been defined.
Type: String
Parameter Sets: (All)
Aliases: path
Required: False
Position: 0
Default value: $PSRemoteOpArchive
Accept pipeline input: False
Accept wildcard characters: False
Enter a computer name to filter on.
Type: String
Parameter Sets: (All)
Aliases: cn
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Select the newest X number of results.
Type: Int32
Parameter Sets: (All)
Aliases: Last
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Display the raw contents of the result file. This can be useful when you get an error parsing the data file.
Type: SwitchParameter
Parameter Sets: raw
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/