Skip to content

Instantly share code, notes, and snippets.

@kpatnayakuni
Created January 21, 2019 14:40
Show Gist options
  • Select an option

  • Save kpatnayakuni/83164d969cb58a804ecae0d5cfeaf731 to your computer and use it in GitHub Desktop.

Select an option

Save kpatnayakuni/83164d969cb58a804ecae0d5cfeaf731 to your computer and use it in GitHub Desktop.
# Along with the named paramaters
New-Item -Path C:\Windows\Temp\ -Name Delete.txt -ItemType File -Value "Hello World!" -Force
# With hash table
$paramtable = @{
Path = 'C:\Windows\Temp\'
Name = 'Delete.txt'
ItemType = 'File'
Value = 'Hello World!'
Force = $true
}
New-Item @paramtable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment