|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: Write-NcFile
NAME
Write-NcFile
SYNOPSIS
Write data into a named file.
SYNTAX
Write-NcFile [-Path] <String> -Data <String[]> [-NoClobber] [-Append] [-Appe
ndLine] [-NoTruncate] [-Separator <String>] [-Stream <String>] [-VserverCont
ext <String>] [-Controller <NcController[]>] [-Offset <Int64>] [<CommonParam
eters>]
Write-NcFile [-Path] <String> -RawData <Byte[]> [-NoClobber] [-Append] [-App
endLine] [-NoTruncate] [-Stream <String>] [-VserverContext <String>] [-Contr
oller <NcController[]>] [-Offset <Int64>] [<CommonParameters>]
DESCRIPTION
Write data into a named file. If the file does not previously exist, it wi
ll be created; the owner of the file will be root and it will not be readabl
e or writable by non-root users. This cmdlet is limited to transfers of 1 M
B and should only be used on normal files. The results for other file types
such as LUNs is undefined.
PARAMETERS
-Path <String>
Pathname of the file to write. For example: "/vol/<volume>/<file>".
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Data <String[]>
ASCII text to be written to the file.
Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-NoClobber
If specified, file will not be overwritten if it exists.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Append
If specified, file will be appended to. Ignored if Offset is specified.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-AppendLine
If specified, file will be appended to on a new line. Ignored if Offset
is specified.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-NoTruncate
If specified, file will not be truncated before being written to. Ignor
ed if non-zero Offset if specified.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Separator <String>
Separator used between lines of input. May be an empty string. Default
is a newline (`n).
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Stream <String>
A stream is an on disk structure which contains a sequence of bytes, ana
logous to a file. A stream is always associated with exactly one file.
Characters that are valid for a file name are also valid for the stream
-name. e.g., 'meta', 'resource1'.
Use this parameter if the data should be written to the named stream ass
ociated with the file.
Default is empty stream name, in which case the data is written to the f
ile.
This parameter is available in Data ONTAP 8.2 or later.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-VserverContext <String>
Vserver to which to direct this command. If the currently connected con
troller (as embodied by an NcController object) represents a cluster, th
ere are multiple means to address commands to one of its vservers. Eith
er set the Vserver field on the NcController object to direct all subseq
uent commands to that vserver, or supply the VserverContext parameter to
an individual cmdlet. Only cmdlets which may be invoked on vservers of
fer the VserverContext parameter.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <NcController[]>
A clustered Data ONTAP controller to receive this cmdlet, as embodied by
an NcController object. This parameter is returned by the Connect-NcCo
ntroller cmdlet. If not specified, the value in the global variable Cur
rentNcController is used. In the latter case, if CurrentNcController co
ntains a collection of NcController objects, this cmdlet is invoked on e
ach controller in succession.
Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Offset <Int64>
Offset into file at which to start writing.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RawData <Byte[]>
Array of bytes to be written to the file.
Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
NOTES
Category: file
API: file-write-file, file-truncate-file
Family: vserver
-------------- Example 1 --------------
C:\PS>Write-NcFile /vol/vol1/hosts -RawData (Get-Content c:\windows\system32
\drivers\etc\hosts -Encoding byte)
Copy a file from the local host to a new file on a vserver. This example wo
rks for any file, text or binary.
RELATED LINKS
Read-NcFile
| Copyright © 2013 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|