Skip to content

Latest commit

 

History

History
195 lines (149 loc) · 3.94 KB

Copy-KshFile.md

File metadata and controls

195 lines (149 loc) · 3.94 KB
external help file Module Name online version schema
SPClientCore.dll-Help.xml
SPClientCore
2.0.0

Copy-KshFile

SYNOPSIS

Copies a file.

SYNTAX

ParamSet1

Copy-KshFile [-Identity] <File> [-NewUrl] <Uri> [-Overwrite] [-KeepBoth] [-ResetAuthorAndCreatedOnCopy]
 [-RetainEditorAndModifiedOnMove] [-ShouldBypassSharedLocks] [<CommonParameters>]

ParamSet2

Copy-KshFile [-Identity] <File> [-NewUrl] <Uri> [-Overwrite] [-Legacy] [-PassThru] [<CommonParameters>]

DESCRIPTION

The Copy-KshFile cmdlet creates a copy from the file.

EXAMPLES

Example 1

PS C:\> Copy-KshFile -Identity (Get-KshFile -FolderUrl '/sites/japan/hr/Shared%20Documents/README.txt') -NewUrl 'https://example.sharepoint.com/Shared%20Documents/README.txt'

Copies a file.

Example 2

PS C:\> Copy-KshFile -Identity (Get-KshFile -FolderUrl '/sites/japan/hr/Shared%20Documents/README.txt') -NewUrl '/sites/japan/hr/Shared%20Documents/README_old.txt' -Legacy

Copies a file. (Use legacy API)

PARAMETERS

-Identity

Specifies the file.

Type: File
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-KeepBoth

If specified, both file should be kept if a file already exists at the specified destination.

Type: SwitchParameter
Parameter Sets: ParamSet1
Aliases:

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

-Legacy

If specified, uses legacy API.

Type: SwitchParameter
Parameter Sets: ParamSet2
Aliases:

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

-NewUrl

Specifies the URL.

Type: Uri
Parameter Sets: (All)
Aliases:

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

-Overwrite

If specified, overwrites the existing file.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-PassThru

If specified, returns the updated object.

Type: SwitchParameter
Parameter Sets: ParamSet2
Aliases:

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

-ResetAuthorAndCreatedOnCopy

If specified, resets author and created datetime on the copied file.

Type: SwitchParameter
Parameter Sets: ParamSet1
Aliases:

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

-RetainEditorAndModifiedOnMove

If specified, retains editor and modified datetime on the moved file.

Type: SwitchParameter
Parameter Sets: ParamSet1
Aliases:

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

-ShouldBypassSharedLocks

If specified, the shared locks on the source file should be by passed.

Type: SwitchParameter
Parameter Sets: ParamSet1
Aliases:

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

Karamem0.SharePoint.PowerShell.Models.V1.File

OUTPUTS

Karamem0.SharePoint.PowerShell.Models.V1.File

NOTES

RELATED LINKS