Unable to process powershell function with content from windows form

后端 未结 1 2116
北恋
北恋 2021-01-27 14:16
function CalendarShare {
    Add-MailboxFolderPermission -Identity ${FromUser.Text} -AccessRights Editor -User ${ToUser.Text}
}

When the program is run

相关标签:
1条回答
  • 2021-01-27 14:21

    Note: This is assuming that both $FromUser and $ToUser are textboxes

    You aren't using your variable correctly for the identity parameter, should be:

    function CalendarShare {
        Add-MailboxFolderPermission -Identity $FromUser.Text -AccessRights Editor -User $ToUser.Text}
    }
    
    0 讨论(0)
提交回复
热议问题