first commit

This commit is contained in:
Iwan Clement
2020-11-03 18:55:20 +01:00
commit 1808f43f53
12 changed files with 354 additions and 0 deletions

17
Exercise Files/03_04/03_04.ps1 Executable file
View File

@@ -0,0 +1,17 @@
# Reason for analyzing
# Scripts are growing
# Human error
# Scripts are to be shared
# Quality standards are recognized as important
Install-Module -Name PSScriptAnalyzer
Get-Command -Module PSScriptAnalyzer
Get-ScriptAnalyzerRule
# PSAvoidUsingCmdletAliases
# PSAvoidGlobalFunctions -- read details
# PSAvoidUsingComputerNameHardcoded -- error
# PSAvoidUsingInvokeExpression -- security hole (code insertion)
Invoke-ScriptAnalyzer -Path ".\03_04-02.ps1"

View File

@@ -0,0 +1,7 @@
$RunMe = Read-Host -Prompt 'What would you like to run today?'
Invoke-Expression -Command $RunMe
Get-MyUsers -OU Management
Get-Process -ComputerName dc01 | Out-File C:\ScriptOutput\Processes.txt