Merge branch 'main' of https://git.azuze.fr/kawa/ps-scripts
This commit is contained in:
		@@ -317,9 +317,9 @@ $label4.Size = New-Object System.Drawing.Size(66, 13)
 | 
			
		||||
$label4.TabIndex = 3
 | 
			
		||||
$label4.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
 | 
			
		||||
##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))){ 
 | 
			
		||||
		$pnpConnection -match "@{Url=(?<content>.*)}"
 | 
			
		||||
		$pnpConnection -match "Url                                        : (?<content>.*)/"
 | 
			
		||||
		$pnpConnectionUrl = $matches["content"]
 | 
			
		||||
		$label4.Text = "Connecté"
 | 
			
		||||
		$label4.ForeColor = [System.Drawing.Color]::Green
 | 
			
		||||
@@ -367,7 +367,9 @@ $LresultsMove.Name = "LresultsMove"
 | 
			
		||||
$LresultsMove.FullRowSelect = true
 | 
			
		||||
$LresultsMove.Size = New-Object System.Drawing.Size(776, 190)
 | 
			
		||||
$LresultsMove.TabIndex = 7
 | 
			
		||||
$LresultsMove.UseCompatibleStateImageBehavior = $false
 | 
			
		||||
$LresultsMove.AutoSize = $true
 | 
			
		||||
#$LresultsMove.MultiColumn = $false
 | 
			
		||||
#$LresultsMove.UseCompatibleStateImageBehavior = $false
 | 
			
		||||
#
 | 
			
		||||
# FMain
 | 
			
		||||
#
 | 
			
		||||
@@ -386,7 +388,7 @@ $BlistSites.Add_Click({
 | 
			
		||||
	#On vide la variable pnpConnection pour ne pas avoir de faux positifs
 | 
			
		||||
	$pnpConnection=$Null
 | 
			
		||||
	#On stocke la derniere connection PnP
 | 
			
		||||
	$pnpConnection = Get-PnPConnection
 | 
			
		||||
	$pnpConnection = Get-PnPConnection | Out-string
 | 
			
		||||
	#A ameliorer, mais pour l'instant, ca devrait passer
 | 
			
		||||
	if(-not ([string]::IsNullOrEmpty($pnpConnection))){
 | 
			
		||||
		$CBdestSite.Items.Clear()
 | 
			
		||||
@@ -415,14 +417,20 @@ $BlistSites.Add_Click({
 | 
			
		||||
##Bouger les dossiers
 | 
			
		||||
$Bgo.Add_Click({
 | 
			
		||||
	$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
 | 
			
		||||
##Connexion Sharepoint
 | 
			
		||||
$BconnectSP.Add_Click({
 | 
			
		||||
 | 
			
		||||
	$pnpConnection=$null
 | 
			
		||||
	$pnpConnection = Get-PnPConnection
 | 
			
		||||
	$pnpConnection = Get-PnPConnection | Out-string
 | 
			
		||||
	$tenantURL = $URLTenant.Text
 | 
			
		||||
	$connResults = Connect-PnPOnline -Url $tenantURL -Interactive 2>&1 | Out-String
 | 
			
		||||
	
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user