//TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPWorkflowDefinitionTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The workflow definition to add.
                var definition = "";
                // From Cmdlet Help: Overrides the default behavior, which is to publish workflow definitions.
                var doNotPublish = "";

                var results = scope.ExecuteCommand("Add-PnPWorkflowDefinition",
                                                   new CommandParameter("Definition", definition),
                                                   new CommandParameter("DoNotPublish", doNotPublish));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void InvokePnPSiteDesignTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The Site Design Id or an actual Site Design object to apply
                var identity = "";
                // From Cmdlet Help: The URL of the web to apply the site design to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline.
                var webUrl = "";

                var results = scope.ExecuteCommand("Invoke-PnPSiteDesign",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("WebUrl", webUrl));

                Assert.IsNotNull(results);
            }
        }
Пример #3
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void StopPnPWorkflowInstanceTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The instance to stop
                var identity = "";
                // From Cmdlet Help: Forcefully terminate the workflow instead of cancelling. Works on errored and non-responsive workflows. Deletes all created tasks. Does not notify participants.
                var force = "";

                var results = scope.ExecuteCommand("Stop-PnPWorkflowInstance",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #4
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPAzureCertificateTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Path to the certificate (*.pfx)
                var certificatePath = "";
                // From Cmdlet Help: Password to the certificate (*.pfx)
                var certificatePassword = "";

                var results = scope.ExecuteCommand("Get-PnPAzureCertificate",
                                                   new CommandParameter("CertificatePath", certificatePath),
                                                   new CommandParameter("CertificatePassword", certificatePassword));

                Assert.IsNotNull(results);
            }
        }
Пример #5
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPWebPartTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Full server relative URL of the web part page, e.g. /sites/mysite/sitepages/home.aspx
                var serverRelativePageUrl = "";
                // From Cmdlet Help: The identity of the web part, this can be the web part guid or a web part object
                var identity = "";

                var results = scope.ExecuteCommand("Get-PnPWebPart",
                                                   new CommandParameter("ServerRelativePageUrl", serverRelativePageUrl),
                                                   new CommandParameter("Identity", identity));

                Assert.IsNotNull(results);
            }
        }
Пример #6
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPStoredCredentialTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The credential to remove
                var name = "";
                // From Cmdlet Help: If specified you will not be asked for confirmation
                var force = "";

                var results = scope.ExecuteCommand("Remove-PnPStoredCredential",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #7
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPTenantSequenceSiteTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The sequence to retrieve the site from
                var sequence = "";
                // From Cmdlet Help: Optional Id of the site
                var identity = "";

                var results = scope.ExecuteCommand("Get-PnPTenantSequenceSite",
                                                   new CommandParameter("Sequence", sequence),
                                                   new CommandParameter("Identity", identity));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPIndexedPropertyTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Key of the property bag value to be indexed
                var key = "";
                // From Cmdlet Help: The list object or name where to set the indexed property
                var list = "";

                var results = scope.ExecuteCommand("Add-PnPIndexedProperty",
                                                   new CommandParameter("Key", key),
                                                   new CommandParameter("List", list));

                Assert.IsNotNull(results);
            }
        }
Пример #9
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPFieldFromXmlTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // From Cmdlet Help: The name of the list, its ID or an actual list object where this field needs to be added
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: CAML snippet containing the field definition. See http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx
                var fieldXml = "";

                var results = scope.ExecuteCommand("Add-PnPFieldFromXml",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("FieldXml", fieldXml));

                Assert.IsNotNull(results);
            }
        }
Пример #10
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void ResetPnPLabelTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The ID or Url of the list
                var list = "";
                // From Cmdlet Help: Reset label on existing items in the library
                var syncToItems = "";

                var results = scope.ExecuteCommand("Reset-PnPLabel",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("SyncToItems", syncToItems));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPClientSideComponentTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The name of the page
                var page = "";
                // From Cmdlet Help: The instance id of the component
                var instanceId = "";

                var results = scope.ExecuteCommand("Get-PnPClientSideComponent",
                                                   new CommandParameter("Page", page),
                                                   new CommandParameter("InstanceId", instanceId));

                Assert.IsNotNull(results);
            }
        }
Пример #12
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPWorkflowSubscriptionTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The name of the subscription
                var name = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The name of the workflow definition
                var definitionName = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The list to add the workflow to
                var list = "";
                // From Cmdlet Help: Switch if the workflow should be started manually, default value is 'true'
                var startManually = "";
                // From Cmdlet Help: Should the workflow run when an new item is created
                var startOnCreated = "";
                // From Cmdlet Help: Should the workflow run when an item is changed
                var startOnChanged = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The name of the History list
                var historyListName = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The name of the task list
                var taskListName      = "";
                var associationValues = "";

                var results = scope.ExecuteCommand("Add-PnPWorkflowSubscription",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("DefinitionName", definitionName),
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("StartManually", startManually),
                                                   new CommandParameter("StartOnCreated", startOnCreated),
                                                   new CommandParameter("StartOnChanged", startOnChanged),
                                                   new CommandParameter("HistoryListName", historyListName),
                                                   new CommandParameter("TaskListName", taskListName),
                                                   new CommandParameter("AssociationValues", associationValues));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void UninstallPnPAppInstanceTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Appinstance or Id of the addin to remove.
                var identity = "";
                // From Cmdlet Help: Do not ask for confirmation.
                var force = "";

                var results = scope.ExecuteCommand("Uninstall-PnPAppInstance",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #14
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPPublishingImageRenditionTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The display name or id of the Image Rendition.
                var identity = "";
                // From Cmdlet Help: If provided, no confirmation will be asked to remove the Image Rendition.
                var force = "";

                var results = scope.ExecuteCommand("Remove-PnPPublishingImageRendition",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #15
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPRoleDefinitionTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The identity of the role definition, either a RoleDefinition object or a the name of roledefinition
                var identity = "";
                // From Cmdlet Help: Do not ask for confirmation to delete the role definition
                var force = "";

                var results = scope.ExecuteCommand("Remove-PnPRoleDefinition",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPAvailableClientSideComponentsTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The name of the page.
                var page = "";
                // From Cmdlet Help: Specifies the component instance or Id to look for.
                var component = "";

                var results = scope.ExecuteCommand("Get-PnPAvailableClientSideComponents",
                                                   new CommandParameter("Page", page),
                                                   new CommandParameter("Component", component));

                Assert.IsNotNull(results);
            }
        }
Пример #17
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPStorageEntityTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The key of the value to remove.
                var key = "";
                // From Cmdlet Help: Defines the scope of the storage entity. Defaults to Tenant.
                var scopeVar = "";

                var results = scope.ExecuteCommand("Remove-PnPStorageEntity",
                                                   new CommandParameter("Key", key),
                                                   new CommandParameter("Scope", scopeVar));

                Assert.IsNotNull(results);
            }
        }
Пример #18
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPTenantSequenceSiteTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                var site = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The sequence to add the site to
                var sequence = "";

                var results = scope.ExecuteCommand("Add-PnPTenantSequenceSite",
                                                   new CommandParameter("Site", site),
                                                   new CommandParameter("Sequence", sequence));

                Assert.IsNotNull(results);
            }
        }
Пример #19
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPSiteDesignTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The ID of the site design to remove
                var identity = "";
                // From Cmdlet Help: If specified you will not be asked to confirm removing the specified Site Design
                var force = "";

                var results = scope.ExecuteCommand("Remove-PnPSiteDesign",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #20
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void UpdatePnPAppTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the Id or an actual app metadata instance
                var identity = "";
                // From Cmdlet Help: Defines which app catalog to use. Defaults to Tenant
                var scopeVar = "";

                var results = scope.ExecuteCommand("Update-PnPApp",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Scope", scopeVar));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RemovePnPClientSidePageTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The name of the page
                var identity = "";
                // From Cmdlet Help: Specifying the Force parameter will skip the confirmation question.
                var force = "";

                var results = scope.ExecuteCommand("Remove-PnPClientSidePage",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
Пример #22
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void ReadPnPTenantTemplateTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Filename to read from, optionally including full path.
                var path = "";
                // From Cmdlet Help: Allows you to specify ITemplateProviderExtension to execute while loading the template.
                var templateProviderExtensions = "";

                var results = scope.ExecuteCommand("Read-PnPTenantTemplate",
                                                   new CommandParameter("Path", path),
                                                   new CommandParameter("TemplateProviderExtensions", templateProviderExtensions));

                Assert.IsNotNull(results);
            }
        }
Пример #23
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPLabelTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The ID or Url of the list
                var list = "";
                // From Cmdlet Help: If provided, the results will be returned as values instead of in written text and will include more detailed information
                var valuesOnly = "";

                var results = scope.ExecuteCommand("Get-PnPLabel",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("ValuesOnly", valuesOnly));

                Assert.IsNotNull(results);
            }
        }
Пример #24
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void NewPnPTermTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The name of the term.
                var name = "";
                // From Cmdlet Help: The Id to use for the term; if not specified, or the empty GUID, a random GUID is generated and used.
                var id = "";
                // From Cmdlet Help: The locale id to use for the term. Defaults to the current locale id.
                var lcid = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The termset to add the term to.
                var termSet = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The termgroup to create the term in.
                var termGroup = "";
                // From Cmdlet Help: Descriptive text to help users understand the intended use of this term.
                var description = "";
                // From Cmdlet Help: Custom Properties
                var customProperties = "";
                // From Cmdlet Help: Custom Properties
                var localCustomProperties = "";
                // From Cmdlet Help: Term store to check; if not specified the default term store is used.
                var termStore = "";

                var results = scope.ExecuteCommand("New-PnPTerm",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Id", id),
                                                   new CommandParameter("Lcid", lcid),
                                                   new CommandParameter("TermSet", termSet),
                                                   new CommandParameter("TermGroup", termGroup),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("CustomProperties", customProperties),
                                                   new CommandParameter("LocalCustomProperties", localCustomProperties),
                                                   new CommandParameter("TermStore", termStore));

                Assert.IsNotNull(results);
            }
        }
Пример #25
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPOffice365GroupToSiteTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Url of the site to be connected to an Microsoft 365 Group
                var url = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the alias of the group. Cannot contain spaces.
                var alias = "";
                // From Cmdlet Help: The optional description of the group
                var description = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The display name of the group
                var displayName = "";
                // From Cmdlet Help: Specifies the classification of the group
                var classification = "";
                // From Cmdlet Help: Specifies if the group is public. Defaults to false.
                var isPublic = "";
                // From Cmdlet Help: Specifies if the current site home page is kept. Defaults to false.
                var keepOldHomePage = "";
                // From Cmdlet Help: If specified the site will be associated to the hubsite as identified by this id
                var hubSiteId = "";
                // From Cmdlet Help: The array UPN values of the group's owners.
                var owners = "";

                var results = scope.ExecuteCommand("Add-PnPOffice365GroupToSite",
                                                   new CommandParameter("Url", url),
                                                   new CommandParameter("Alias", alias),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("DisplayName", displayName),
                                                   new CommandParameter("Classification", classification),
                                                   new CommandParameter("IsPublic", isPublic),
                                                   new CommandParameter("KeepOldHomePage", keepOldHomePage),
                                                   new CommandParameter("HubSiteId", hubSiteId),
                                                   new CommandParameter("Owners", owners));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void NewPnPUnifiedGroupTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The Display Name of the Microsoft 365 Group
                var displayName = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The Description of the Microsoft 365 Group
                var description = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The Mail Nickname of the Microsoft 365 Group. Cannot contain spaces.
                var mailNickname = "";
                // From Cmdlet Help: The array UPN values of the group's owners
                var owners = "";
                // From Cmdlet Help: The array UPN values of the group's members
                var members = "";
                // From Cmdlet Help: Makes the group private when selected
                var isPrivate = "";
                // From Cmdlet Help: The path to the logo file of to set
                var groupLogoPath = "";
                // From Cmdlet Help: Creates a Microsoft Teams team associated with created group
                var createTeam = "";
                // From Cmdlet Help: Specifying the Force parameter will skip the confirmation question.
                var force = "";

                var results = scope.ExecuteCommand("New-PnPUnifiedGroup",
                                                   new CommandParameter("DisplayName", displayName),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("MailNickname", mailNickname),
                                                   new CommandParameter("Owners", owners),
                                                   new CommandParameter("Members", members),
                                                   new CommandParameter("IsPrivate", isPrivate),
                                                   new CommandParameter("GroupLogoPath", groupLogoPath),
                                                   new CommandParameter("CreateTeam", createTeam),
                                                   new CommandParameter("Force", force));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void NewPnPGroupTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The Title of the group
                var title = "";
                // From Cmdlet Help: The description for the group
                var description = "";
                // From Cmdlet Help: The owner for the group, which can be a user or another group
                var owner = "";
                // From Cmdlet Help: A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group
                var allowRequestToJoinLeave = "";
                // From Cmdlet Help: A switch parameter that specifies whether users are automatically added or removed when they make a request
                var autoAcceptRequestToJoinLeave = "";
                // From Cmdlet Help: A switch parameter that specifies whether group members can modify membership in the group
                var allowMembersEditMembership = "";
                // From Cmdlet Help: A switch parameter that specifies whether only group members are allowed to view the list of members in the group
                var onlyAllowMembersViewMembership = "";
                // From Cmdlet Help: A switch parameter that disallows group members to view membership.
                var disallowMembersViewMembership = "";
                // From Cmdlet Help: The e-mail address to which membership requests are sent
                var requestToJoinEmail = "";
                var setAssociatedGroup = "";

                var results = scope.ExecuteCommand("New-PnPGroup",
                                                   new CommandParameter("Title", title),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("Owner", owner),
                                                   new CommandParameter("AllowRequestToJoinLeave", allowRequestToJoinLeave),
                                                   new CommandParameter("AutoAcceptRequestToJoinLeave", autoAcceptRequestToJoinLeave),
                                                   new CommandParameter("AllowMembersEditMembership", allowMembersEditMembership),
                                                   new CommandParameter("OnlyAllowMembersViewMembership", onlyAllowMembersViewMembership),
                                                   new CommandParameter("DisallowMembersViewMembership", disallowMembersViewMembership),
                                                   new CommandParameter("RequestToJoinEmail", requestToJoinEmail),
                                                   new CommandParameter("SetAssociatedGroup", setAssociatedGroup));

                Assert.IsNotNull(results);
            }
        }
Пример #28
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void GetPnPFolderTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: Site or server relative URL of the folder to retrieve. In the case of a server relative url, make sure that the url starts with the managed path as the current web.
                var url = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Name, ID or instance of a list or document library to retrieve the folders residing in it for.
                var list = "";

                var results = scope.ExecuteCommand("Get-PnPFolder",
                                                   new CommandParameter("Url", url),
                                                   new CommandParameter("List", list));

                Assert.IsNotNull(results);
            }
        }
Пример #29
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void TestPnPListItemIsRecordTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The ID, Title or Url of the list.
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The ID of the listitem, or actual ListItem object
                var identity = "";

                var results = scope.ExecuteCommand("Test-PnPListItemIsRecord",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Identity", identity));

                Assert.IsNotNull(results);
            }
        }
Пример #30
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void RenamePnPFolderTest()
        {
            using (var scope = new PSTestScope(true))
            {
                // Complete writing cmd parameters

                // This is a mandatory parameter
                // From Cmdlet Help: The folder to rename
                var folder = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The new folder name
                var targetFolderName = "";

                var results = scope.ExecuteCommand("Rename-PnPFolder",
                                                   new CommandParameter("Folder", folder),
                                                   new CommandParameter("TargetFolderName", targetFolderName));

                Assert.IsNotNull(results);
            }
        }