Ki jan yo kreye yon dosye nouvo nan poechèl?
new-item keyword creates a new file in the filesystem. The type of item new item creates depends on where the item is being created. Pou egzanp, nouvo atik kapab tou kreye kle rejis ak antre si yo itilize nan rejis la.
Type the following command in to create a new file in the current path:
NI {filename.extension}
pi wo a la se jaden an pou lòd sa a…
nouvo-atik {filename.extension}
egzanp
NI fun.txt
Paramèt kapab tou itilize ak nouvo atik.
Sa ki anba la kreye yon dosye ki nan chemen an kounye a ak kèk kontni:
NI -n fun.txt -p . -it f -v 'this is some silly text'
In the above example we have added the -name, -path and -itemtype parameters with their default values. Omitting these will generate the same result.
ni fun.txt -v 'this is some silly text'
Si ou vle recouvrir yon dosye ki deja egziste itilize -force a oswa -f paramèt:
ni fun.txt -v 'this is some silly text' -f
Kreye dosye miltip nan anyè aktyèl la:
ni -it f -p 'file.txt', 'fun.txt'
Kreye dosye miltip nan c nan:/ rasin ak bagay sa yo anyè
ni -it f -p 'c:\file.txt', 'c:\things\fun.txt'
kreye Anyè
Ou ka kreye yon anyè nouvo olye pou yo mkdir oswa md lè l sèvi avèk nouvo atik yo lòd, ki ak anviwònman kalite a atik kòm anyè.
NI plezi -li d
Kreye yon anyè nouvo nan rasin lan c:
NI -n plezi -li d -p c:\
Kreye repèrtwar miltip nan chemen an aktyèl:
ni -it d -p 'fun', 'silly'
Kreye repèrtwar miltip nan c nan:/ rasin ak bagay sa yo anyè
ni -it d -p 'c:\folder', 'c:\things\fun'
tab sa a montre paramèt yo ak li nan jaden
| parameters | Alyas | egzanp | Deskripsyon |
-non |
-n oswa ki pa gen paramèt |
NI fun.txt |
Espesifye non an atik nan nouvo |
-itemtype |
-li |
-it d oswa -it dir oswa -it directory-it f oswa -it file |
Espesifye ki kalite atik yo kreye. Kreye dosye pa default. |
-fòs |
-f |
-f |
Recouvrir dosye ki deja egziste. |
-valè |
-v |
-v 'Some file content...'
|
Ekri kontni nan dosye |
-chemen |
-p |
-p c:\ |
Path nan kote yo ta dwe atik la nouvo dwe kreye |
Gen kèk kòmandman ki se itil ak yo lòd, ki NI:
ls – Get-ChildItem, lists files and directories of the current working directory. egzanp ls
gc – Get-Content, wè sa ki nan yon egzanp dosye. gc fun.txt
md – mkdir, fè anyè egzanp. md mynewdirectory
rm– Remove-Item, retire anyè oswa dosye

Conteúdo top de mais, parabéns!