AI generated code to start with
This commit is contained in:
parent
80fb3c6347
commit
5821a8cb44
28
MPE_SP-CreateFolder.ps1
Normal file
28
MPE_SP-CreateFolder.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
## AI Generated
|
||||
|
||||
# Replace with your actual values
|
||||
$siteID = "mpeeng.sharepoint.com,a39156fa-de97-42ae-b37e-8d2798786586,2b81c888-6319-4649-b505-c26225324fb8"
|
||||
$parentItemID = "your-parent-item-id"
|
||||
$accessToken = "your-access-token"
|
||||
|
||||
# API endpoint
|
||||
$url = "https://graph.microsoft.com/v1.0/sites/$siteID/drive/items/$parentItemID/children"
|
||||
|
||||
# Folder details
|
||||
$folder = @{
|
||||
name = "New Folder"
|
||||
folder = @{}
|
||||
"@microsoft.graph.conflictBehavior" = "rename"
|
||||
}
|
||||
|
||||
# Convert folder details to JSON
|
||||
$folderJSON = $folder | ConvertTo-Json
|
||||
|
||||
# Create HTTP request
|
||||
$response = Invoke-RestMethod -Uri $url -Method Post -Headers @{
|
||||
Authorization = "Bearer $accessToken"
|
||||
'Content-Type' = 'application/json'
|
||||
} -Body $folderJSON
|
||||
|
||||
# Output response
|
||||
$response
|
1
SiteInfo.xml
Normal file
1
SiteInfo.xml
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user