50 строки
1.2 KiB
PowerShell
50 строки
1.2 KiB
PowerShell
<#
|
|
|
|
.SYNOPSIS
|
|
Script to create help short cut and solution folder shortcut.
|
|
|
|
.PARAMETER helpfile
|
|
path to the help url file.
|
|
|
|
.PARAMETER solutionPath
|
|
path to the solution folder with data and source.
|
|
|
|
#>
|
|
[CmdletBinding()]
|
|
param(
|
|
[parameter(Mandatory=$true, Position=1, ParameterSetName = "LCR")]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$helpfile,
|
|
|
|
[parameter(Mandatory=$true, Position=2, ParameterSetName = "LCR")]
|
|
[ValidateNotNullOrEmpty()]
|
|
[string]$solutionPath
|
|
)
|
|
|
|
#git clone
|
|
$desktop = [Environment]::GetFolderPath("Desktop")
|
|
|
|
$desktop = $desktop + '\'
|
|
|
|
#create the help link in startup program
|
|
|
|
$startmenu = [Environment]::GetFolderPath("StartMenu")
|
|
$startupfolder = $startmenu + '\Programs\Startup\'
|
|
# We create this since the user startup folder is only created after first login
|
|
# Alternative is to add is to all user startup
|
|
mkdir $startupfolder
|
|
#copy
|
|
$down = $helpfile
|
|
Write-Host $down
|
|
Write-Host $startmenu
|
|
ls $startmenu
|
|
Write-Host $startupfolder
|
|
ls $startupfolder
|
|
cp -Verbose $down $startupfolder
|
|
cp -Verbose $down $desktop
|
|
|
|
#create shortcut to solution folder on desktop
|
|
$WsShell = New-Object -ComObject WScript.Shell
|
|
$shortcut = $WsShell.CreateShortcut($desktop + "LoanChargeOff.lnk")
|
|
$shortcut.TargetPath = $solutionPath
|
|
$shortcut.Save() |