Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Write-user
function Write-User
{
param(
[parameter(mandatory)]
[string]$fileName
)
write-output "Username: $env:UserName" | tee-object -filepath $filename
write-output "Current Command: $($MyInvocation.MyCommand.Path)" | tee-object -filepath $filename
write-output "Current Script: $($MyInvocation.MyCommand.ScriptName)"| tee-object -filepath $filename
write-output "Script Running on: $env:COMPUTERNAME" | tee-object -filepath $filename
write-output "Current Version of Powershell: $($psversiontable.psversion)" | tee-object -filepath $filename
}
describe 'Write-user'{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment