|
|
Data ONTAP® PowerShell Toolkit
|
Provider name
DataONTAP
Synopsis
Provides access to files and directories on Data ONTAP controllers using the same symantics as the PowerShell FileSystem provider. See 'Get-Help about_FileSystem' to learn more.
Description
The DataONTAP provider exposes PowerShell drives that correspond to the file system on Data ONTAP controllers, allowing you to get, add, change, clear, and delete files and directories in PowerShell. The provider is based on Data ONTAP APIs for reading/writing files and directories. So while the provider does not require any particular network protocols (i.e. CIFS) to be licensed, I/O operations are considerably slower and are primarily suited to administrative tasks.
Examples
To use the provider, start by connecting to a Data ONTAP controller:
PS C:\> Connect-NaController dunn
Name Address Ontapi Version
---- ------- ------ -------
dunn 10.61.167.60 1.12 NetApp Release 7.3.3: Thu Mar 11 22:29:52 PST 2010
Next, create a PSDrive object:
PS C:\> Mount-NaController
Name Used (GB) Free (GB) Provider Root
---- --------- --------- -------- ----
dunn DataONTAP /
Then, change the current working directory to the new drive:
PS C:\> cd dunn:
PS dunn:\>
Most of the various file listing and manipulation commands work as expected. The /etc directory is a shortcut to the etc directory on the root volume.
PS C:\> dir
Name Type Size Created Modified Owner Group Perm Empty
---- ---- ---- ------- -------- ----- ----- ---- -----
. directory 4 KB
etc directory 12 KB 8/12/2008 12/13/2010 0 0 1070
vol directory 4 KB
PS C:\> cd /vol/vol0/etc
PS C:\> type rc
#Auto-generated by zapi_net_config Fri Oct 1 14:52:04 EDT 2010
hostname dunn
ifconfig e0a `hostname`-e0a netmask 255.255.255.0 broadcast 10.61.167.255 flowcontrol full partner e0a up
ifconfig e0b up
ifconfig e0c up
ifconfig e0d up
ifconfig e0a alias 10.61.167.98 netmask 255.255.255.0
route add net default 10.61.167.1 1
routed on
options dns.domainname rtprre.testdomain
options dns.enable on
options nis.enable off
savecore
When transferring binary files to Data ONTAP, use the –Encoding and –ReadCount parameters as follows:
PS C:\> Get-Content C:\file.bin -Encoding byte -ReadCount 128kb | Set-Content file.bin -Encoding byte
When transferring binary files from Data ONTAP, use the –Encoding parameter as follows:
PS C:\> Get-Content file.bin -Encoding byte | Set-Content C:\file.bin -Encoding byte
Dynamic parameters
- –Encoding
- Unknown. The encoding type is unknown or invalid. The data can be treated as binary.
- String. Uses the encoding type for a string.
- Unicode. Encodes in UTF-16 format using the little-endian byte order.
- Byte. Encodes a set of characters into a sequence of bytes.
- BigEndianUnicode. Encodes in UTF-16 format using the big-endian byte order.
- UTF8. Encodes in UTF-8 format.
- UTF7. Encodes in UTF-7 format.
- ASCII. Uses the encoding for the ASCII (7-bit) character set. ASCII is the default.
- Cmdlets Supported: Add-Content, Get-Content, Set-Content
- –Delimiter
- Specifies the line delimiter to use when writing the file. The default is "\n" (end of line).
- Cmdlets Supported: Add-Content, Set-Content
Related links
- about_Providers
- about_FileSystem
| Copyright © 2012 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|