Add functionnality to Move button
This commit is contained in:
parent
f120caa0e2
commit
f401ceb825
|
@ -317,9 +317,9 @@ $label4.Size = New-Object System.Drawing.Size(66, 13)
|
||||||
$label4.TabIndex = 3
|
$label4.TabIndex = 3
|
||||||
$label4.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
$label4.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
|
||||||
##On modifie le texte du label en fonction de l'état initial de la connection a PNPOnline
|
##On modifie le texte du label en fonction de l'état initial de la connection a PNPOnline
|
||||||
$pnpConnection = Get-PnPConnection
|
$pnpConnection = Get-PnPConnection | Out-string
|
||||||
if(-not ([string]::IsNullOrEmpty($pnpConnection))){
|
if(-not ([string]::IsNullOrEmpty($pnpConnection))){
|
||||||
$pnpConnection -match "@{Url=(?<content>.*)}"
|
$pnpConnection -match "Url : (?<content>.*)/"
|
||||||
$pnpConnectionUrl = $matches["content"]
|
$pnpConnectionUrl = $matches["content"]
|
||||||
$label4.Text = "Connecté"
|
$label4.Text = "Connecté"
|
||||||
$label4.ForeColor = [System.Drawing.Color]::Green
|
$label4.ForeColor = [System.Drawing.Color]::Green
|
||||||
|
@ -366,7 +366,9 @@ $LresultsMove.Location = New-Object System.Drawing.Point(8, 173)
|
||||||
$LresultsMove.Name = "LresultsMove"
|
$LresultsMove.Name = "LresultsMove"
|
||||||
$LresultsMove.Size = New-Object System.Drawing.Size(776, 190)
|
$LresultsMove.Size = New-Object System.Drawing.Size(776, 190)
|
||||||
$LresultsMove.TabIndex = 7
|
$LresultsMove.TabIndex = 7
|
||||||
$LresultsMove.UseCompatibleStateImageBehavior = $false
|
$LresultsMove.AutoSize = $true
|
||||||
|
#$LresultsMove.MultiColumn = $false
|
||||||
|
#$LresultsMove.UseCompatibleStateImageBehavior = $false
|
||||||
#
|
#
|
||||||
# FMain
|
# FMain
|
||||||
#
|
#
|
||||||
|
@ -385,7 +387,7 @@ $BlistSites.Add_Click({
|
||||||
#On vide la variable pnpConnection pour ne pas avoir de faux positifs
|
#On vide la variable pnpConnection pour ne pas avoir de faux positifs
|
||||||
$pnpConnection=$Null
|
$pnpConnection=$Null
|
||||||
#On stocke la derniere connection PnP
|
#On stocke la derniere connection PnP
|
||||||
$pnpConnection = Get-PnPConnection
|
$pnpConnection = Get-PnPConnection | Out-string
|
||||||
#A ameliorer, mais pour l'instant, ca devrait passer
|
#A ameliorer, mais pour l'instant, ca devrait passer
|
||||||
if(-not ([string]::IsNullOrEmpty($pnpConnection))){
|
if(-not ([string]::IsNullOrEmpty($pnpConnection))){
|
||||||
$CBdestSite.Items.Clear()
|
$CBdestSite.Items.Clear()
|
||||||
|
@ -414,14 +416,20 @@ $BlistSites.Add_Click({
|
||||||
##Bouger les dossiers
|
##Bouger les dossiers
|
||||||
$Bgo.Add_Click({
|
$Bgo.Add_Click({
|
||||||
$sourceSite = $CBsourceSite.Text
|
$sourceSite = $CBsourceSite.Text
|
||||||
$LresultsMove.Items.Add($sourceSite)
|
$destSite = $CBdestSite.Text
|
||||||
|
|
||||||
|
$jobMovePending = Copy-PnPFile -SourceUrl $sourceSite -TargetUrl $destSite -Force -OverwriteIfAlreadyExists
|
||||||
|
$jobStatus = Receive-PnPCopyMoveJobStatus -Job $jobMovePending
|
||||||
|
Write-Host $jobStatus
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
#Onglet Parametres
|
#Onglet Parametres
|
||||||
##Connexion Sharepoint
|
##Connexion Sharepoint
|
||||||
$BconnectSP.Add_Click({
|
$BconnectSP.Add_Click({
|
||||||
|
|
||||||
$pnpConnection=$null
|
$pnpConnection=$null
|
||||||
$pnpConnection = Get-PnPConnection
|
$pnpConnection = Get-PnPConnection | Out-string
|
||||||
$tenantURL = $URLTenant.Text
|
$tenantURL = $URLTenant.Text
|
||||||
$connResults = Connect-PnPOnline -Url $tenantURL -Interactive 2>&1 | Out-String
|
$connResults = Connect-PnPOnline -Url $tenantURL -Interactive 2>&1 | Out-String
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue