How do I get the id of a folder object using ISHRemote?

Hi,

I am trying to use ISHRemote to move folder contents and am failing to see how I get the ID for the ToFolderId parameter if I am creating the folder dynamically via ISHRemote as well

I have tried the code below but Get-IshFolder returns a folder

Move-IshFolder -IshSession $ishSession -FolderID 5061139 -ToFolderId (Get-IshFolder(Add-IshFolder -IshSession $ishSession -ParentFolderId $parentfolderID -FolderType ISHNone -FolderName $folderName -ReadAccess @("") -OwnedBy ""))

How do I get the ID values from and folder object?

Thanks in advance,

Ann

  • Hi Ann,

    Where possible the pipeline friendly objects like IshFolder or IshObject are preferred in ISHRemote. It seems v1 cmdlet Move-IshFolder is asking for the Id (so card_id).

    $ishBaseFolder = Get-IshFolder -BaseFolder Data
    $ishBaseFolder.IshFolderRef
    # would return: 3222

    So if I may suggest a rewrite it would look like

    $ishFolder = Add-IshFolder -IshSession $ishSession -ParentFolderId $parentfolderID -FolderType ISHNone -FolderName $folderName -ReadAccess @("") -OwnedBy "")
    Move-IshFolder -IshSession $ishSession -FolderId 5061139 -ToFolderId $ishFolder.IshFolderRef

    The Add-IshFolder cmdlet returns the just created folder for further usage, so the Get-IshFolder was superfluous.

    -Dave