From ec111816d5d8bd070ff25c074dc57e4cde91b8c4 Mon Sep 17 00:00:00 2001 From: kawa Date: Thu, 7 Mar 2024 22:42:03 +0100 Subject: [PATCH] Change stuff --- Sharepoint/gui/spmover/spmover1.ps1 | 57 ++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/Sharepoint/gui/spmover/spmover1.ps1 b/Sharepoint/gui/spmover/spmover1.ps1 index 9073ff2..cda6987 100644 --- a/Sharepoint/gui/spmover/spmover1.ps1 +++ b/Sharepoint/gui/spmover/spmover1.ps1 @@ -34,8 +34,8 @@ $Mquestion = New-Object System.Windows.Forms.ToolStripMenuItem $MQuestionApropos = New-Object System.Windows.Forms.ToolStripMenuItem $MQuestionWiki = New-Object System.Windows.Forms.ToolStripMenuItem $Bgo = New-Object System.Windows.Forms.Button -$comboBox1 = New-Object System.Windows.Forms.ComboBox -$comboBox2 = New-Object System.Windows.Forms.ComboBox +$CBsourceSite = New-Object System.Windows.Forms.ComboBox +$CBdestSite = New-Object System.Windows.Forms.ComboBox $progressBar1 = New-Object System.Windows.Forms.ProgressBar $sourceInfo = New-Object System.Windows.Forms.ToolTip($components) $label1 = New-Object System.Windows.Forms.Label @@ -98,23 +98,23 @@ $Bgo.TabIndex = 1 $Bgo.Text = "GO" $Bgo.UseVisualStyleBackColor = $true # -# comboBox1 +# CBsourceSite # -$comboBox1.ForeColor = [System.Drawing.Color]::White -$comboBox1.FormattingEnabled = $true -$comboBox1.Location = New-Object System.Drawing.Point(27, 131) -$comboBox1.Name = "comboBox1" -$comboBox1.Size = New-Object System.Drawing.Size(587, 21) -$comboBox1.TabIndex = 2 +$CBsourceSite.ForeColor = [System.Drawing.Color]::White +$CBsourceSite.FormattingEnabled = $true +$CBsourceSite.Location = New-Object System.Drawing.Point(27, 131) +$CBsourceSite.Name = "CBsourceSite" +$CBsourceSite.Size = New-Object System.Drawing.Size(587, 21) +$CBsourceSite.TabIndex = 2 # -# comboBox2 +# CBdestSite # -$comboBox2.ForeColor = [System.Drawing.Color]::White -$comboBox2.FormattingEnabled = $true -$comboBox2.Location = New-Object System.Drawing.Point(27, 182) -$comboBox2.Name = "comboBox2" -$comboBox2.Size = New-Object System.Drawing.Size(587, 21) -$comboBox2.TabIndex = 3 +$CBdestSite.ForeColor = [System.Drawing.Color]::White +$CBdestSite.FormattingEnabled = $true +$CBdestSite.Location = New-Object System.Drawing.Point(27, 182) +$CBdestSite.Name = "CBdestSite" +$CBdestSite.Size = New-Object System.Drawing.Size(587, 21) +$CBdestSite.TabIndex = 3 # # progressBar1 # @@ -148,8 +148,8 @@ $FMain.ClientSize = New-Object System.Drawing.Size(800, 450) $FMain.Controls.Add($label2) $FMain.Controls.Add($label1) $FMain.Controls.Add($progressBar1) -$FMain.Controls.Add($comboBox2) -$FMain.Controls.Add($comboBox1) +$FMain.Controls.Add($CBdestSite) +$FMain.Controls.Add($CBsourceSite) $FMain.Controls.Add($Bgo) $FMain.Controls.Add($menuStrip1) $FMain.ForeColor = [System.Drawing.Color]::Snow @@ -157,7 +157,28 @@ $FMain.MainMenuStrip = $menuStrip1 $FMain.Name = "FMain" $FMain.Text = "SharePoint Mover GUI" +$CBsourceSite.SelectedIndex = 0 +$CBtargetSite.SelectedIndex = 0 +$MConnexionSharepoint.add_click({ + + + Connect-PnPOnline -Url $tenantURL -Interactive + ###############On recupere puis stocke la liste des sites dans les box + $ComboboxList = (Get-SPOSite | Select Url).name + $CBsourceSite.Items.AddRange($ComboboxList) + + $ComboboxList = (Get-SPOSite | Select Url).name + $CBtargetSite.Items.AddRange($ComboboxList) + ############### + +}) + +$Bgo.add_click({ + + Move-PnPFile -SiteRelativeUrl $srcSite -TargetUrl $destSite -Force -AllowSchemaMismatch + +})