refactor: Replace Import-Module with dot-sourcing in PowerShell scripts
This commit is contained in:
parent
b8049f6f85
commit
2077423bc0
@ -5,8 +5,7 @@ Import-Module Microsoft.Graph.Files
|
|||||||
|
|
||||||
# Import our components
|
# Import our components
|
||||||
. "$PSScriptRoot\GraphConfig.ps1"
|
. "$PSScriptRoot\GraphConfig.ps1"
|
||||||
$SharePointFunctions = "$PSScriptRoot\SharePointFunctions.ps1"
|
. "$PSScriptRoot\SharePointFunctions.ps1"
|
||||||
Import-Module $SharePointFunctions -Force
|
|
||||||
. "$PSScriptRoot\EventHandlers.ps1"
|
. "$PSScriptRoot\EventHandlers.ps1"
|
||||||
|
|
||||||
# Create main form
|
# Create main form
|
||||||
|
|||||||
@ -2,17 +2,6 @@
|
|||||||
|
|
||||||
$script:config = $null # Initialize config variable
|
$script:config = $null # Initialize config variable
|
||||||
|
|
||||||
# Export functions that will be called from other scripts
|
|
||||||
Export-ModuleMember -Function @(
|
|
||||||
'Load-Config',
|
|
||||||
'Save-Config',
|
|
||||||
'Get-FolderBrowser',
|
|
||||||
'Connect-SharePoint',
|
|
||||||
'List-XlsFiles',
|
|
||||||
'Convert-Files',
|
|
||||||
'Move-Files'
|
|
||||||
)
|
|
||||||
|
|
||||||
# Load configuration from config.json
|
# Load configuration from config.json
|
||||||
function Load-Config {
|
function Load-Config {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user