You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PS C:\Users\Windows-32> ls function:
CommandType Name
---------------FunctionA:
Function addInt
Function B:
Function C:
Function cd..
Function cd\
Function Clear-Host
Function D:
Function default_value
Function Disable-PSRemoting
Function E:
Function F:
Function fixed_params
Function fun1
Function G:
Function Get-Verb
Function H:
Function help
Function I:
Function ImportSystemModules
Function J:
Function K:
Function L:
Function M:
Function mkdir
Function more
Function N:
Function O:
Function P:
Function prompt
Function Q:
Function R:
Function S:
Function switchable
Function T:
Function TabExpansion
Function U:
Function V:
Function var_params
Function W:
Function X:
Function Y:
Function Z:
PS C:\Users\Windows-32>
Exercise
Create a function which accepts name of a process or service and stops it.
PS C:\Windows\system32>Get-Process notepad
Get-Process : Cannot find a process with the name "notepad". Verify the process name and call the cmdlet again.
At line:1 char:12+Get-Process<<<< notepad
+ CategoryInfo : ObjectNotFound: (notepad:String) [Get-Process], ProcessCommandException
+ FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand
PS C:\Windows\system32>