Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # to load c:powershellscriptscluster_utils.ps1 if it isn't already loaded
- . require cluster_utils
- $global:loaded_scripts=@{}
- function require([string]$filename){
- if (!$loaded_scripts[$filename]){
- . c:powershellscripts$filename.ps1
- $loaded_scripts[$filename]=get-date
- }
- }
- function reload($filename){
- . c:powershellscripts$filename.ps1
- $loaded_scripts[$filename]=get-date
- }
- $global:scriptdirectory = 'C:powershellscripts'
- $global:loaded_scripts = @{}
- function require {
- param(
- [string[]]$filenames=$(throw 'Please specify scripts to load'),
- [string]$path=$scriptdirectory
- )
- $unloadedFilenames = $filenames | where { -not $loaded_scripts[$_] }
- reload $unloadedFilenames $path
- }
- function reload {
- param(
- [string[]]$filenames=$(throw 'Please specify scripts to reload'),
- [string]$path=$scriptdirectory
- )
- foreach( $filename in $filenames ) {
- . (Join-Path $path $filename)
- $loaded_scripts[$filename] = Get-Date
- }
- }
- $global:scriptdirectory= 'c:powershellscripts'
- $global:loaded_scripts=@{}
- function require(){
- param ([string]$filename, [string]$path=$scriptdirectory)
- if (!$loaded_scripts[$filename]){
- . (Join-Path $path $filename)
- $loaded_scripts[$filename]=get-date
- }
- }
- function reload(){
- param ([string]$filename, [string]$path=$scriptdirectory)
- . (Join-Path $path $filename)
- $loaded_scripts[$filename]=get-date
- }
Add Comment
Please, Sign In to add comment