Skip to content

Instantly share code, notes, and snippets.

@numbnet
Last active April 8, 2021 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save numbnet/452d35065b0778bcf6954381095bb9c1 to your computer and use it in GitHub Desktop.
Save numbnet/452d35065b0778bcf6954381095bb9c1 to your computer and use it in GitHub Desktop.
Net core app
Rename-Computer -NewName NN -Force
Restart-Computer -ComputerName NN -Confirm -Force
Invoke-RestMethod -OutFile dotnet-install.ps1 `
-Uri https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
.\dotnet-install.ps1 -install
.\dotnet-install.ps1 -start
echo
############
Invoke-RestMethod -OutFile bitwarden.ps1 `
-Uri https://raw.githubusercontent.com/bitwarden/server/master/scripts/bitwarden.ps1
.\bitwarden.ps1 -install
.\bitwarden.ps1 -start
. .\try_execute_function.ps1
write-host "Попытка выполнить внешнюю функцию."
write-host "Пожалуйста, введите значение, которое вы хотите узнать:"
write-host "1. Результат выполнения функции"
write-host "2. Дату время и погоду"
write-host "3. Дату и время"
$ex=read-host
if ($ex -eq "1" -or $ex -eq "2" -or $ex -eq "3") {
write-host "Выполняю функцию:"
}
elseif ([string]::IsNullOrEmpty($ex)) {
write-host "Вы указали неверный параметр."
break;
}
switch ($ex){
"1"{
Execute-Function
}
"2"{
Get-DateOne
}
"3"{
Get-DateTwo
}
Default
{
write-host "Такой функции не существует."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment