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

                // This is a mandatory parameter
                var enabled = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Turn records management on
                var on = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Turn records management off
                var off = "";

                var results = scope.ExecuteCommand("Set-PnPInPlaceRecordsManagement",
                                                   new CommandParameter("Enabled", enabled),
                                                   new CommandParameter("On", on),
                                                   new CommandParameter("Off", off));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The credential to set
                var name = "";
                // This is a mandatory parameter
                var username = "";
                // From Cmdlet Help: If not specified you will be prompted to enter your password.
                // If you want to specify this value use ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force
                var password = "";

                var results = scope.ExecuteCommand("Add-PnPStoredCredential",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Username", username),
                                                   new CommandParameter("Password", password));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The title of the site script
                var title = "";
                // From Cmdlet Help: The description of the site script
                var description = "";
                // This is a mandatory parameter
                // From Cmdlet Help: A JSON string containing the site script
                var content = "";

                var results = scope.ExecuteCommand("Add-PnPSiteScript",
                                                   new CommandParameter("Title", title),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("Content", content));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The Hub Site to set the permissions on to associate another site with this Hub Site
                var identity = "";
                // This is a mandatory parameter
                // From Cmdlet Help: One or more usernames that will be given or revoked the permission to associate a site with this Hub Site. It does not replace permissions given out before but adds to the already existing permissions.
                var principals = "";
                // From Cmdlet Help: Provide Join to give permissions to associate a site with this Hub Site or use None to revoke the permissions for the user(s) specified with the Principals argument
                var rights = "";

                var results = scope.ExecuteCommand("Grant-PnPHubSiteRights",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("Principals", principals),
                                                   new CommandParameter("Rights", rights));

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

                // From Cmdlet Help: Name or id of the JavaScriptLink to remove. Omit if you want to remove all JavaScript Links.
                var identity = "";
                var fromSite = "";
                // From Cmdlet Help: Use the -Force flag to bypass the confirmation question
                var force = "";
                // From Cmdlet Help: Define if the JavaScriptLink is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection.
                var scopeVar = "";

                var results = scope.ExecuteCommand("Remove-PnPJavaScriptLink",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("FromSite", fromSite),
                                                   new CommandParameter("Force", force),
                                                   new CommandParameter("Scope", scopeVar));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Id of the recycle bin item or the recycle bin item object itself to restore
                var identity = "";
                // This is a mandatory parameter
                // From Cmdlet Help: If provided all items will be stored
                var all = "";
                // From Cmdlet Help: If provided, no confirmation will be asked to restore the recycle bin item
                var force = "";

                var results = scope.ExecuteCommand("Restore-PnPRecycleBinItem",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("All", all),
                                                   new CommandParameter("Force", force));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the list to which the content type needs to be added
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the content type that needs to be added to the list
                var contentType = "";
                // From Cmdlet Help: Specify if the content type needs to be the default content type or not
                var defaultContentType = "";

                var results = scope.ExecuteCommand("Add-PnPContentTypeToList",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("ContentType", contentType),
                                                   new CommandParameter("DefaultContentType", defaultContentType));

                Assert.IsNotNull(results);
            }
        }
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void SetPnPListItemAsRecordTest()
        {
            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 = "";
                // From Cmdlet Help: The declaration date
                var declarationDate = "";

                var results = scope.ExecuteCommand("Set-PnPListItemAsRecord",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("DeclarationDate", declarationDate));

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

                // From Cmdlet Help: The list object or name where the remote event receiver needs to be added. If omitted, the remote event receiver will be added to the web.
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The name of the remote event receiver
                var name = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The URL of the remote event receiver web service
                var url = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The type of the event receiver like ItemAdded, ItemAdding. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceivertype.aspx for the full list of available types.
                var eventReceiverType = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The synchronization type: Asynchronous or Synchronous
                var synchronization = "";
                // From Cmdlet Help: The sequence number where this remote event receiver should be placed
                var sequenceNumber = "";
                // From Cmdlet Help: Overwrites the output file if it exists.
                var force = "";

                var results = scope.ExecuteCommand("Add-PnPEventReceiver",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Url", url),
                                                   new CommandParameter("EventReceiverType", eventReceiverType),
                                                   new CommandParameter("Synchronization", synchronization),
                                                   new CommandParameter("SequenceNumber", sequenceNumber),
                                                   new CommandParameter("Force", force));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The list to query
                var list = "";
                // From Cmdlet Help: The ID of the item to retrieve
                var id = "";
                // From Cmdlet Help: The unique id (GUID) of the item to retrieve
                var uniqueId = "";
                // From Cmdlet Help: The CAML query to execute against the list
                var query = "";
                // From Cmdlet Help: The server relative URL of a list folder from which results will be returned.
                var folderServerRelativeUrl = "";
                // From Cmdlet Help: The fields to retrieve. If not specified all fields will be loaded in the returned list object.
                var fields = "";
                // From Cmdlet Help: The number of items to retrieve per page request.
                var pageSize = "";
                // From Cmdlet Help: The script block to run after every page request.
                var scriptBlock = "";

                var results = scope.ExecuteCommand("Get-PnPListItem",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Id", id),
                                                   new CommandParameter("UniqueId", uniqueId),
                                                   new CommandParameter("Query", query),
                                                   new CommandParameter("FolderServerRelativeUrl", folderServerRelativeUrl),
                                                   new CommandParameter("Fields", fields),
                                                   new CommandParameter("PageSize", pageSize),
                                                   new CommandParameter("ScriptBlock", scriptBlock));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The Identity of the Microsoft 365 Group
                var identity = "";
                // From Cmdlet Help: The DisplayName of the group to set
                var displayName = "";
                // From Cmdlet Help: The Description of the group to set
                var description = "";
                // From Cmdlet Help: The array UPN values of owners to set to the group. Note: Will replace owners.
                var owners = "";
                // From Cmdlet Help: The array UPN values of members to set to the group. Note: Will replace 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 = "";

                var results = scope.ExecuteCommand("Set-PnPUnifiedGroup",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("DisplayName", displayName),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("Owners", owners),
                                                   new CommandParameter("Members", members),
                                                   new CommandParameter("IsPrivate", isPrivate),
                                                   new CommandParameter("GroupLogoPath", groupLogoPath),
                                                   new CommandParameter("CreateTeam", createTeam));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the URL of the site to generate a Site Script from
                var url = "";
                // From Cmdlet Help: Allows specifying one or more site relative URLs of lists that should be included into the Site Script, i.e. "Shared Documents","List\MyList"
                var lists = "";
                // From Cmdlet Help: If specified will include all supported components into the Site Script
                var includeAll = "";
                // From Cmdlet Help: If specified will include the branding of the site into the Site Script
                var includeBranding = "";
                // From Cmdlet Help: If specified will include navigation links into the Site Script
                var includeLinksToExportedItems = "";
                // From Cmdlet Help: If specified will include the regional settings into the Site Script
                var includeRegionalSettings = "";
                // From Cmdlet Help: If specified will include the external sharing configuration into the Site Script
                var includeSiteExternalSharingCapability = "";
                // From Cmdlet Help: If specified will include the branding of the site into the Site Script
                var includeTheme = "";

                var results = scope.ExecuteCommand("Get-PnPSiteScriptFromWeb",
                                                   new CommandParameter("Url", url),
                                                   new CommandParameter("Lists", lists),
                                                   new CommandParameter("IncludeAll", includeAll),
                                                   new CommandParameter("IncludeBranding", includeBranding),
                                                   new CommandParameter("IncludeLinksToExportedItems", includeLinksToExportedItems),
                                                   new CommandParameter("IncludeRegionalSettings", includeRegionalSettings),
                                                   new CommandParameter("IncludeSiteExternalSharingCapability", includeSiteExternalSharingCapability),
                                                   new CommandParameter("IncludeTheme", includeTheme));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the name of the page.
                var name = "";
                // From Cmdlet Help: Specifies the layout type of the page.
                var layoutVarType = "";
                // From Cmdlet Help: Allows to promote the page for a specific purpose (HomePage | NewsPage)
                var promoteAs = "";
                // From Cmdlet Help: Specify either the name, ID or an actual content type.
                var contentType = "";
                // From Cmdlet Help: Enables or Disables the comments on the page
                var commentsEnabled = "";
                // From Cmdlet Help: Publishes the page once it is saved. Applicable to libraries set to create major and minor versions.
                var publish = "";
                // From Cmdlet Help: Type of layout used for the header
                var headerLayoutVarType = "";
                // From Cmdlet Help: Sets the message for publishing the page.
                var publishMessage = "";

                var results = scope.ExecuteCommand("Add-PnPClientSidePage",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("LayoutType", layoutVarType),
                                                   new CommandParameter("PromoteAs", promoteAs),
                                                   new CommandParameter("ContentType", contentType),
                                                   new CommandParameter("CommentsEnabled", commentsEnabled),
                                                   new CommandParameter("Publish", publish),
                                                   new CommandParameter("HeaderLayoutType", headerLayoutVarType),
                                                   new CommandParameter("PublishMessage", publishMessage));

                Assert.IsNotNull(results);
            }
        }
Esempio n. 14
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void AddPnPAlertTest()
        {
            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 = "";
                // From Cmdlet Help: Alert title
                var title = "";
                // From Cmdlet Help: User to create the alert for (User ID, login name or actual User object). Skip this parameter to create an alert for the current user. Note: Only site owners can create alerts for other users.
                var user = "";
                // From Cmdlet Help: Alert delivery method
                var deliveryMethod = "";
                // From Cmdlet Help: Alert change type
                var changeType = "";
                // From Cmdlet Help: Alert frequency
                var frequency = "";
                // From Cmdlet Help: Alert filter
                var filter = "";
                // From Cmdlet Help: Alert time (if frequency is not immediate)
                var time = "";

                var results = scope.ExecuteCommand("Add-PnPAlert",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Title", title),
                                                   new CommandParameter("User", user),
                                                   new CommandParameter("DeliveryMethod", deliveryMethod),
                                                   new CommandParameter("ChangeType", changeType),
                                                   new CommandParameter("Frequency", frequency),
                                                   new CommandParameter("Filter", filter),
                                                   new CommandParameter("Time", time));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Wildcard query
                var match = "";
                // This is a mandatory parameter
                // From Cmdlet Help: List title, url or an actual List object to query
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Folder object or relative url of a folder to query
                var folder = "";

                var results = scope.ExecuteCommand("Find-PnPFile",
                                                   new CommandParameter("Match", match),
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("Folder", folder));

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

                // From Cmdlet Help: Exports the builtin web part mapping file
                var builtInWebPartMapping = "";
                // From Cmdlet Help: Exports the builtin pagelayout mapping file (only needed for publishing page transformation)
                var builtInPageLayoutVarMapping = "";
                // From Cmdlet Help: Analyzes the pagelayouts in the current publishing portal and exports them as a pagelayout mapping file
                var customPageLayoutVarMapping = "";
                // From Cmdlet Help: The name of the publishing page to export a page layout mapping file for
                var publishingPage = "";
                // From Cmdlet Help: Set this flag if you also want to analyze the OOB page layouts...typically these are covered via the default mapping, but if you've updated these page layouts you might want to analyze them again
                var analyzeOOBPageLayoutVars = "";
                // From Cmdlet Help: The folder to created the mapping file(s) in
                var folder = "";
                // From Cmdlet Help: Overwrites existing mapping files
                var overwrite = "";
                // From Cmdlet Help: Outputs analyser logging to the console
                var logging = "";

                var results = scope.ExecuteCommand("Export-PnPClientSidePageMapping",
                                                   new CommandParameter("BuiltInWebPartMapping", builtInWebPartMapping),
                                                   new CommandParameter("BuiltInPageLayoutMapping", builtInPageLayoutVarMapping),
                                                   new CommandParameter("CustomPageLayoutMapping", customPageLayoutVarMapping),
                                                   new CommandParameter("PublishingPage", publishingPage),
                                                   new CommandParameter("AnalyzeOOBPageLayouts", analyzeOOBPageLayoutVars),
                                                   new CommandParameter("Folder", folder),
                                                   new CommandParameter("Overwrite", overwrite),
                                                   new CommandParameter("Logging", logging));

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

                // This is a mandatory parameter
                var key = "";
                // This is a mandatory parameter
                var value = "";
                // This is a mandatory parameter
                var indexed = "";
                // From Cmdlet Help: Site relative url of the folder. See examples for use.
                var folder = "";

                var results = scope.ExecuteCommand("Set-PnPPropertyBagValue",
                                                   new CommandParameter("Key", key),
                                                   new CommandParameter("Value", value),
                                                   new CommandParameter("Indexed", indexed),
                                                   new CommandParameter("Folder", folder));

                Assert.IsNotNull(results);
            }
        }
Esempio n. 18
0
        //TODO: This is a scaffold of the cmdlet - complete the unit test
        //[TestMethod]
        public void SetPnPClientSideTextTest()
        {
            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 = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The instance id of the text component
                var instanceId = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Text to set
                var text = "";

                var results = scope.ExecuteCommand("Set-PnPClientSideText",
                                                   new CommandParameter("Page", page),
                                                   new CommandParameter("InstanceId", instanceId),
                                                   new CommandParameter("Text", text));

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

                // This is a mandatory parameter
                // From Cmdlet Help: An array of page layout files to set as available page layouts for the site.
                var pageLayoutVars = "";
                // This is a mandatory parameter
                // From Cmdlet Help: An array of page layout files to set as available page layouts for the site.
                var allowAllPageLayoutVars = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Set the available page layouts to inherit from the parent site.
                var inheritPageLayoutVars = "";

                var results = scope.ExecuteCommand("Set-PnPAvailablePageLayouts",
                                                   new CommandParameter("PageLayouts", pageLayoutVars),
                                                   new CommandParameter("AllowAllPageLayouts", allowAllPageLayoutVars),
                                                   new CommandParameter("InheritPageLayouts", inheritPageLayoutVars));

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

                // From Cmdlet Help: Specifies the Master page URL based on the server relative URL
                var masterPageServerRelativeUrl = "";
                // From Cmdlet Help: Specifies the custom Master page URL based on the server relative URL
                var customMasterPageServerRelativeUrl = "";
                // From Cmdlet Help: Specifies the Master page URL based on the site relative URL
                var masterPageSiteRelativeUrl = "";
                // From Cmdlet Help: Specifies the custom Master page URL based on the site relative URL
                var customMasterPageSiteRelativeUrl = "";

                var results = scope.ExecuteCommand("Set-PnPMasterPage",
                                                   new CommandParameter("MasterPageServerRelativeUrl", masterPageServerRelativeUrl),
                                                   new CommandParameter("CustomMasterPageServerRelativeUrl", customMasterPageServerRelativeUrl),
                                                   new CommandParameter("MasterPageSiteRelativeUrl", masterPageSiteRelativeUrl),
                                                   new CommandParameter("CustomMasterPageSiteRelativeUrl", customMasterPageSiteRelativeUrl));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|[email protected]
                var account = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The quota to set on the OneDrive for Business site of the user, in bytes
                var quota = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The quota to set on the OneDrive for Business site of the user when to start showing warnings about the drive nearing being full, in bytes
                var quotaWarning = "";

                var results = scope.ExecuteCommand("Set-PnPUserOneDriveQuota",
                                                   new CommandParameter("Account", account),
                                                   new CommandParameter("Quota", quota),
                                                   new CommandParameter("QuotaWarning", quotaWarning));

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

                // From Cmdlet Help: Get a specific group by name
                var identity = "";
                // From Cmdlet Help: Retrieve the associated member group
                var associatedMemberGroup = "";
                // From Cmdlet Help: Retrieve the associated visitor group
                var associatedVisitorGroup = "";
                // From Cmdlet Help: Retrieve the associated owner group
                var associatedOwnerGroup = "";

                var results = scope.ExecuteCommand("Get-PnPGroup",
                                                   new CommandParameter("Identity", identity),
                                                   new CommandParameter("AssociatedMemberGroup", associatedMemberGroup),
                                                   new CommandParameter("AssociatedVisitorGroup", associatedVisitorGroup),
                                                   new CommandParameter("AssociatedOwnerGroup", associatedOwnerGroup));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The folder name
                var name = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The parent folder in the site
                var folder  = "";
                var recycle = "";
                var force   = "";

                var results = scope.ExecuteCommand("Remove-PnPFolder",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Folder", folder),
                                                   new CommandParameter("Recycle", recycle),
                                                   new CommandParameter("Force", force));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The List for which workflow instances should be retrieved
                var list = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The List Item for which workflow instances should be retrieved
                var listItem = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The workflow subscription for which workflow instances should be retrieved
                var workflowSubscription = "";

                var results = scope.ExecuteCommand("Get-PnPWorkflowInstance",
                                                   new CommandParameter("List", list),
                                                   new CommandParameter("ListItem", listItem),
                                                   new CommandParameter("WorkflowSubscription", workflowSubscription));

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

                // This is a mandatory parameter
                // From Cmdlet Help: Server relative URL to the file
                var serverRelativeUrl = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Site relative URL to the file
                var siteRelativeUrl = "";
                var recycle         = "";
                var force           = "";

                var results = scope.ExecuteCommand("Remove-PnPFile",
                                                   new CommandParameter("ServerRelativeUrl", serverRelativeUrl),
                                                   new CommandParameter("SiteRelativeUrl", siteRelativeUrl),
                                                   new CommandParameter("Recycle", recycle),
                                                   new CommandParameter("Force", force));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The title of the new web
                var title = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The URL of the new web
                var url = "";
                // From Cmdlet Help: The description of the new web
                var description = "";
                // From Cmdlet Help: The language id of the new web. default = 1033 for English
                var locale = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The site definition template to use for the new web, e.g. STS#0. Use Get-PnPWebTemplates to fetch a list of available templates
                var template = "";
                // From Cmdlet Help: By default the subweb will inherit its security from its parent, specify this switch to break this inheritance
                var breakInheritance = "";
                // From Cmdlet Help: Specifies whether the site inherits navigation.
                var inheritNavigation = "";

                var results = scope.ExecuteCommand("New-PnPWeb",
                                                   new CommandParameter("Title", title),
                                                   new CommandParameter("Url", url),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("Locale", locale),
                                                   new CommandParameter("Template", template),
                                                   new CommandParameter("BreakInheritance", breakInheritance),
                                                   new CommandParameter("InheritNavigation", inheritNavigation));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The type of cdn to retrieve the policies from
                var cdnType = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The type of the policy to set
                var policyType = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The value of the policy to set
                var policyValue = "";

                var results = scope.ExecuteCommand("Set-PnPTenantCdnPolicy",
                                                   new CommandParameter("CdnType", cdnType),
                                                   new CommandParameter("PolicyType", policyType),
                                                   new CommandParameter("PolicyValue", policyValue));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The title of the site design
                var title = "";
                // This is a mandatory parameter
                // From Cmdlet Help: An array of guids of site scripts
                var siteScriptIds = "";
                // From Cmdlet Help: The description of the site design
                var description = "";
                // From Cmdlet Help: Specifies if the site design is a default site design
                var isDefault = "";
                // From Cmdlet Help: Sets the text for the preview image
                var previewImageAltText = "";
                // From Cmdlet Help: Sets the url to the preview image
                var previewImageUrl = "";
                // This is a mandatory parameter
                // From Cmdlet Help: Specifies the type of site to which this design applies
                var webTemplate = "";

                var results = scope.ExecuteCommand("Add-PnPSiteDesign",
                                                   new CommandParameter("Title", title),
                                                   new CommandParameter("SiteScriptIds", siteScriptIds),
                                                   new CommandParameter("Description", description),
                                                   new CommandParameter("IsDefault", isDefault),
                                                   new CommandParameter("PreviewImageAltText", previewImageAltText),
                                                   new CommandParameter("PreviewImageUrl", previewImageUrl),
                                                   new CommandParameter("WebTemplate", webTemplate));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The Tenant ID to connect to the Office 365 Management API
                var tenantId = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The App\Client ID of the app which gives you access to the Office 365 Management API
                var clientId = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The Client Secret of the app which gives you access to the Office 365 Management API
                var clientSecret = "";

                var results = scope.ExecuteCommand("Get-PnPManagementApiAccessToken",
                                                   new CommandParameter("TenantId", tenantId),
                                                   new CommandParameter("ClientId", clientId),
                                                   new CommandParameter("ClientSecret", clientSecret));

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

                // This is a mandatory parameter
                // From Cmdlet Help: The display name of the Image Rendition.
                var name = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The width of the Image Rendition.
                var width = "";
                // This is a mandatory parameter
                // From Cmdlet Help: The height of the Image Rendition.
                var height = "";

                var results = scope.ExecuteCommand("Add-PnPPublishingImageRendition",
                                                   new CommandParameter("Name", name),
                                                   new CommandParameter("Width", width),
                                                   new CommandParameter("Height", height));

                Assert.IsNotNull(results);
            }
        }