< Back

Move-ODItem

Sat Jan 18, 2020 6:04 pm

NAME Move-ODItem



SYNOPSIS





SYNTAX

Move-ODItem [-AccessToken] <String> [[-ResourceId] <String>] [[-Path] <String>] [[-ElementId] <String>]

[[-DriveId] <String>] [[-TargetPath] <String>] [[-NewName] <String>] [<CommonParameters>]





DESCRIPTION

Moves a file to a new location or renames it.





PARAMETERS

-AccessToken <String>

A valid access token for bearer authorization.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceId <String>

Mandatory for OneDrive 4 Business access. Is the ressource URI: "https://<tenant>-my.sharepoint.com/".

Example: "https://sepagogmbh-my.sharepoint.com/"



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

Specifies the path of the file to be moved.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ElementId <String>

Specifies the element id of the file to be moved. If Path and ElementId are given, the ElementId is used with

a warning.



Required? false

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-DriveId <String>

Specifies the OneDrive drive id. If not set, the default drive is used.



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TargetPath <String>

Save file to the target path in the same OneDrive drive (ElementId for the target path is not supported yet).



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



-NewName <String>

The new name of the file. If missing, the file will only be moved.



Required? false

Position? 7

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Author: Marcel Meurer, marcel.meurer@sepago.de, Twitter: MarcelMeurer



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Move-ODItem -AccessToken $at -path "/Notes.txt" -TargetPath "/x" -NewName "_Notes.txt"



Moves and renames a file in one step



Move-ODItem -AccessToken $at -path "/Notes.txt" -NewName "_Notes.txt" # Rename a file



Move-ODItem -AccessToken $at -path "/Notes.txt" -TargetPath "/x" # Move a file











RELATED LINKS