Complete the code to list all files in the current directory.
Get-ChildItem [1]-File alone lists only files, but no path specified.-Recurse lists files in all subfolders, not just current.The -Path . option tells PowerShell to look in the current directory.
Complete the code to create a new folder named 'Scripts'.
New-Item -ItemType Directory -Name [1]The -Name 'Scripts' creates a folder named 'Scripts'.
Fix the error in the code to copy 'file.txt' to 'backup.txt'.
Copy-Item -Path [1] -Destination 'backup.txt'
The -Path must be the source file, which is 'file.txt'.
Fill both blanks to move all '.txt' files to the 'Archive' folder.
Move-Item -Path [1] -Destination [2]
'*.txt' selects all text files, and 'Archive' is the destination folder.
Fill all three blanks to create a dictionary of file names and their sizes for '.log' files.
$files = Get-ChildItem -Filter [1] | ForEach-Object { @{ [2] = $_.Name; [3] = $_.Length } }
'*.log' filters log files, 'Name' and 'Size' are keys for file name and size.
