Synopsis
Upload a file to NetStorage.
Syntax
Write-NetstorageObject [-LocalPath] <String> -RemotePath <String> [-MTime <String>] [-Size <String>]
[-CheckHash] [-AuthFile <String>] [-Section <String>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Description
Uploads a file to NetStorage from your local machine to a remote path.
Optionally, you can provide the -Size
and -MTime
Parameters when running this operation. If using the -CheckHash
switch parameter, PowerShell will calculate the file hash and provide that to NetStorage to ensure the file is valid upon upload.
> Note: You don't need to prepend paths with the upload directory CP code, this is implied.
Parameters
-AuthFile
Location of your Netstorage auth file.
Defaults to ~/.nsrc, but environment variables will take precedence.
Type: String
Parameter Sets: (All)
Aliases: None
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-CheckHash
Include a sha256 hash of your file with the request, which Netstorage will check.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: None
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
-LocalPath
The location on disk of the file you wish to upload.
Type: String
Parameter Sets: (All)
Aliases: None
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-MTime
The desired modification time for the target content using UNIX epoch time.
Type: String
Parameter Sets: (All)
Aliases: None
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-RemotePath
The remote location you wish to upload your file to.
The Upload Directory prefix is not required.
Type: String
Parameter Sets: (All)
Aliases: None
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Section
EdgeRC section to retrieve authentication credentials from. Defaults to default
.
Type: String
Parameter Sets: (All)
Aliases: None
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Size
Enforce that the uploaded file is precisely $Size size (in bytes).
The server returns a 412 error for size mismatches.
Type: String
Parameter Sets: (All)
Aliases: None
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
None
Outputs
System.Object