< Back

Add-ODItem

Sat Jan 18, 2020 6:03 pm

NAME Add-ODItem



SYNOPSIS





SYNTAX

Add-ODItem [-AccessToken] <String> [[-ResourceId] <String>] [[-Path] <String>] [[-ElementId] <String>] [[-DriveId]

<String>] [-LocalFile] <String> [<CommonParameters>]





DESCRIPTION

Upload an item/file. Warning: An existing file will be overwritten.





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 for the upload folder. If not given, the path is "/".



Required? false

Position? 3

Default value /

Accept pipeline input? false

Accept wildcard characters? false



-ElementId <String>

Specifies the element id for the upload folder. 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



-LocalFile <String>

Path and file of the local file to be uploaded (C:\\data\\data.csv).



Required? true

Position? 6

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:\\>Add-ODItem -AccessToken $AuthToken -Path "/Data/documents/2016" -LocalFile "AzureML with PowerShell.docx"



Upload a file to OneDrive "/data/documents/2016"











RELATED LINKS