Skip to main content

New-XdrEndpointDeviceLiveResponseLibraryFile

SYNOPSIS

Uploads a script file to the Live Response library.

SYNTAX

New-XdrEndpointDeviceLiveResponseLibraryFile [-FilePath] <String> [[-Description] <String>] [-HasParameters]
[[-ParametersDescription] <String>] [-OverrideIfExists] [-ProgressAction <ActionPreference>] [-WhatIf]
[-Confirm] [<CommonParameters>]

DESCRIPTION

Uploads a local script file to the Microsoft Defender XDR Live Response library. The file can then be used with the 'putfile' and 'run' commands during Live Response sessions. Multipart form-data is constructed as a byte array to maintain WebSession cookie compatibility.

EXAMPLES

EXAMPLE 1

New-XdrEndpointDeviceLiveResponseLibraryFile -FilePath 'C:\Scripts\Remediate.ps1'
Uploads Remediate.ps1 to the Live Response library.

EXAMPLE 2

'
Uploads with metadata describing the script parameters.

EXAMPLE 3

New-XdrEndpointDeviceLiveResponseLibraryFile -FilePath 'C:\Scripts\Remediate.ps1' -OverrideIfExists
Replaces an existing library file with the same name.

PARAMETERS

-FilePath

The full path to the local script file to upload.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Description

Optional description for the library file.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-HasParameters

Indicates that the script accepts parameters during execution.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-ParametersDescription

Description of the parameters accepted by the script. Only relevant when -HasParameters is specified.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-OverrideIfExists

If specified, overwrites an existing library file with the same name. Without this switch, uploading a duplicate file name will fail.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The file is not uploaded.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before uploading the file.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

The ProgressAction parameter is a common parameter, not a cmdlet parameter. For more information, see about_CommonParameters.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

Object

Returns the API response containing the uploaded file metadata.

NOTES