.gitlab/NewModule.ps1
#! /usr/bin/pwsh # ___________________________________________ # | | # # | NewModule.ps1 | # # |___________________________________________| # # Pathing. Write-Host "executed in $PSScriptRoot'."; $SEPARATOR = [System.IO.Path]::DirectorySeparatorChar; $PATH_NAME = (Split-Path $PSScriptRoot -Parent) + $SEPARATOR + 'config' + $SEPARATOR + 'name.env'; $PATH_VERSION = (Split-Path $PSScriptRoot -Parent) + $SEPARATOR + 'config' + $SEPARATOR + 'version.env'; $NAME = Get-Content -Path "$PATH_NAME" -TotalCount 1; $VERSION = Get-Content -Path "$PATH_VERSION" -TotalCount 1; $PATH_MANIFEST = (Split-Path $PSScriptRoot -Parent) + $SEPARATOR + $NAME + '.psd1'; # Identity. $AUTHOR = "Frédéric Petit"; $ROOT = $NAME + '.psm1'; $DESCRIPTION = "Show AD Computer state (name free, offline or online) by range and for those that are in use, displays the user logged in. Result exported to a CSV file."; # Do module. $MODULE = @{ Path = $PATH_MANIFEST RootModule = $ROOT ModuleVersion = $VERSION Author = $AUTHOR CompanyName = $AUTHOR Copyright = "Copyright (c) 2024 $NAME by $AUTHOR" Description = $DESCRIPTION PowerShellVersion = "5.1" FunctionsToExport = @() CmdletsToExport = @() AliasesToExport = @() Tags = @("active directory", "range") ProjectUri = "https://gitlab.com/fredericpetit/get-ad-computer-range/" LicenseUri = "https://gitlab.com/fredericpetit/get-ad-computer-range/-/raw/main/LICENSE" IconUri = "https://gitlab.com/uploads/-/system/project/avatar/54554295/find.png" } New-ModuleManifest @MODULE; Write-Host "module writed at '${PATH}'."; |