Merge branch 'main' of https://git.azuze.fr/kawa/ps-scripts
This commit is contained in:
commit
a66fb59b6e
|
@ -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
|
||||||
|
@ -367,7 +367,9 @@ $LresultsMove.Name = "LresultsMove"
|
||||||
$LresultsMove.FullRowSelect = true
|
$LresultsMove.FullRowSelect = true
|
||||||
$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
|
||||||
#
|
#
|
||||||
|
@ -386,7 +388,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()
|
||||||
|
@ -415,14 +417,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