Data ONTAP® PowerShell Toolkit

Switch to Data ONTAP 7-mode documentation.

Cmdlet: Set-NcFileSize


NAME
Set-NcFileSize

SYNOPSIS
Truncate a file.

SYNTAX
Set-NcFileSize [-Path] <String> [[-Size] <String>] [-VserverContext <String>
] [-Controller <NcController[]>] [-WhatIf] [-Confirm] [<CommonParameters>]


DESCRIPTION
Truncate a file. Any data past the truncation point will be lost.


PARAMETERS
-Path <String>
Path of the file to truncate. The value is expected to begin with /vol/<
volumename>.

Required? true
Position? 1
Default value
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

-Size <String>
If provided, the file size is set to this value. The default value is 0.

Required? false
Position? 2
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 Data ONTAP cluster-mode controller to receive this cmdlet, as embodied
by an NcController object. This parameter is returned by the Connect-N
cController cmdlet. If not specified, the value in the global variable
CurrentNcController is used. In the latter case, if CurrentNcController
contains a collection of NcController objects, this cmdlet is invoked o
n each controller in succession.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

-WhatIf


Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Confirm


Required? false
Position? named
Default value
Accept pipeline input? false
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
NetApp.Ontapi.Filer.C.File810.FileInfo


NOTES


Category: file
API: file-truncate-file
Family: vserver

-------------- Example 1 --------------

C:\PS>Set-NcFileSize /vol/vol1/hosts


Set the size of /vol/vol1/hosts to 0 bytes.


Name Type Size Created Modified Owner Group Perm Empty
---- ---- ---- ------- -------- ----- ----- ---- -----
hosts file 0 11/15/2011 11/15/2011 0 0 644



RELATED LINKS
Get-NcFile
Read-NcDirectory







 Data ONTAP® PowerShell Toolkit