This commit is contained in:
Kawawete 2024-03-07 08:19:15 +01:00
parent 6f04ad15ea
commit 327bf76a52
3 changed files with 24 additions and 32 deletions

Binary file not shown.

Binary file not shown.

View File

@ -3,8 +3,8 @@
=========================================================================== ===========================================================================
FileName: spmover1.ps1 FileName: spmover1.ps1
Author: SebastienQUEROL Author: SebastienQUEROL
Created On: 2024/03/06 Created On: 2024/03/07
Last Updated: 2024/03/06 Last Updated: 2024/03/07
Organization: Organization:
Version: v0.1 Version: v0.1
=========================================================================== ===========================================================================
@ -18,31 +18,23 @@
$sbGUI = { $sbGUI = {
param($BaseDir) param($BaseDir)
#region Child Forms #region Environment Setup
$Script:childFormInfo = @{ try {
'MainForm' = @{ Add-Type -AssemblyName System.Windows.Forms
XMLText = @" Add-Type -AssemblyName System.Drawing
<Form Name="MainForm" Size="547, 462">
<TextBox Name="tbx_SiteURL" CharacterCasing="Lower" Location="44, 133" Size="374, 20" Text="adresse du site" />
<TextBox Name="tbx_SourceFolderURL" Location="43, 158" Size="169, 20" Text="Dossier source" /> } catch {Update-ErrorLog -ErrorRecord $_ -Message "Exception encountered during Environment Setup."}
<TextBox Name="tbx_TargetFolderURL" Location="255, 158" Size="165, 20" Text="Dossier de destination" />
<Button Name="btn_Start" Location="437, 134" Size="59, 43" Text="GO !" /> #endregion Environment Setup
<Label Name="lbl_byWho" Font="Comic Sans MS, 0.9" Location="40, 86" Text="by squerol" />
<Label Name="lbl_arrow" Font="Wingdings, 1.5" Location="211, 151" Size="43, 32" Text="F" />
<ListBox Name="lbx_results" Font="Lucida Console, 0.8" HorizontalScrollbar="True" ItemHeight="15" Location="45, 207" ScrollAlwaysVisible="True" Size="448, 184" />
</Form>
"@
}
}
#endregion Child Forms
#region Dot Sourcing of files #region Dot Sourcing of files
$dotSourceDir = $BaseDir $dotSourceDir = $BaseDir
. "$($dotSourceDir)\Functions.ps1" . "$($dotSourceDir)\Functions.ps1"
. "$($dotSourceDir)\EnvSetup.ps1" . "$($dotSourceDir)\Events.ps1"
#endregion Dot Sourcing of files #endregion Dot Sourcing of files
@ -55,15 +47,24 @@ $sbGUI = {
<TextBox Name="tbx_SourceFolderURL" Location="43, 158" Size="169, 20" Text="Dossier source" /> <TextBox Name="tbx_SourceFolderURL" Location="43, 158" Size="169, 20" Text="Dossier source" />
<TextBox Name="tbx_TargetFolderURL" Location="255, 158" Size="165, 20" Text="Dossier de destination" /> <TextBox Name="tbx_TargetFolderURL" Location="255, 158" Size="165, 20" Text="Dossier de destination" />
<Button Name="btn_Start" Location="437, 134" Size="59, 43" Text="GO !" /> <Button Name="btn_Start" Location="437, 134" Size="59, 43" Text="GO !" />
<Label Name="lbl_byWho" Font="Comic Sans MS, 0.8" Location="40, 86" Text="by squerol" /> <Label Name="lbl_byWho" Font="Comic Sans MS, 12pt" Location="40, 86" Text="by squerol" />
<Label Name="lbl_arrow" Font="Wingdings, 1.5" Location="211, 151" Size="43, 32" Text="F" /> <Label Name="lbl_arrow" Font="Wingdings, 26.25pt" Location="211, 151" Size="43, 32" Text="F" />
<ListBox Name="lbx_results" Font="Lucida Console, 0.8" HorizontalScrollbar="True" ItemHeight="15" Location="45, 207" ScrollAlwaysVisible="True" Size="448, 184" /> <ListBox Name="lbx_results" Font="Lucida Console, 11.25pt" HorizontalScrollbar="True" ItemHeight="15" Location="45, 207" ScrollAlwaysVisible="True" Size="448, 184" />
<PictureBox Name="pbx_logo" Image="System.Drawing.Bitmap" Location="41, 18" Size="465, 69" />
</Form> </Form>
"@ "@
} catch {Update-ErrorLog -ErrorRecord $_ -Message "Exception encountered during Form Initialization."} } catch {Update-ErrorLog -ErrorRecord $_ -Message "Exception encountered during Form Initialization."}
#endregion Form Initialization #endregion Form Initialization
#region Event Assignment
try {
$Script:refs['btn_Start'].Add_Click($eventSB['btn_Start'].Click)
} catch {Update-ErrorLog -ErrorRecord $_ -Message "Exception encountered during Event Assignment."}
#endregion Event Assignment
#region Other Actions Before ShowDialog #region Other Actions Before ShowDialog
try { try {
@ -121,12 +122,3 @@ $rsGUI.Dispose()
Exit Exit
#endregion Start Point of Execution #endregion Start Point of Execution
$btn_Start.Add_Click({
connectSP($tbx_SiteURL.Text)
moveSP($tbx_SourceFolderURL.Text,$tbx_TargetFolderURL.Text)
})