mirror of
				https://github.com/esiur/esiur-dotnet.git
				synced 2025-10-30 23:51:34 +00:00 
			
		
		
		
	Added Records
This commit is contained in:
		
							
								
								
									
										36
									
								
								Esiur/Tools/init.ps1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								Esiur/Tools/init.ps1
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
|  | ||||
| param($installPath, $toolsPath, $package, $project) | ||||
|  | ||||
| # NB: Not set for scripts in PowerShell 2.0 | ||||
| if (!$PSScriptRoot) | ||||
| { | ||||
|     $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent | ||||
| } | ||||
|  | ||||
| if ($PSVersionTable.PSVersion -lt '3.0') | ||||
| { | ||||
|     # Import a "dummy" module that contains matching functions that throw on PS2 | ||||
|     Import-Module (Join-Path $PSScriptRoot 'Esiur.psd1') -DisableNameChecking | ||||
|  | ||||
|     return | ||||
| } | ||||
|  | ||||
| $importedModule = Get-Module 'Esiur' | ||||
| $moduleToImport = Test-ModuleManifest (Join-Path $PSScriptRoot 'Esiur.psd1') | ||||
| $import = $true | ||||
| if ($importedModule) | ||||
| { | ||||
|     if ($importedModule.Version -le $moduleToImport.Version) | ||||
|     { | ||||
|         Remove-Module 'Esiur' | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         $import = $false | ||||
|     } | ||||
| } | ||||
|  | ||||
| if ($import) | ||||
| { | ||||
|     Import-Module $moduleToImport -DisableNameChecking | ||||
| } | ||||
		Reference in New Issue
	
	Block a user