Skip to content

Categories

Wolfgang Groß edited this page Mar 25, 2020 · 5 revisions

Categories are meant to group similar entities together. If entities are the files of the TreeStore file system the categories are the directories. The Upmost category /Entities is always there and can't be removed but underneath it categories and subcategories may be created.

Creating Categories

A new category may be created with the New-Item cmdlet using the parameter -ItemType Category:

PS> New-Item /Entities/example_category -ItemType Category

Name             ItemType
----             --------
example_category Category

The output shows the name and the ItemType of the newly created category.

Managing Categories

Categories can be renamed at any time:

PS> Rename-item /Entities/example_category -NewName changed_name

Categories can be copied with a new name or into another category

PS> Copy-Item /Entities/example_category ./Entities/other_category/changed_name

Similar to the powershell file system provider a copy doesn't include item in the source directory. These can be included in the deletion by specifying the -Recurse parameter:

PS> Copy-Item /Entities/example_category /Entities/other_category/changed_name -Recurse

The category /Entities/other_category/changed_name contains now copies of the entities and categories of the source category. Moving the category into another category includes the entities and subcategories of a category naturally:

PS> Move-Item /Entities/example_category /Entities/other_category

An empty category can be removed at any time:

PS> Remove-Item /Entities/example_category

A category which contains entities or subcategories makes powershell ask for confirmation. This can be prevented by specifying the -Recurse parameter

PS> Remove-Item /Entites/example_category -Recurse

Clone this wiki locally