Created
December 16, 2024 21:23
-
-
Save kshyju/b56f307edfad0938cd5f6533ca6c5531 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a directory | |
$directoryPath = "C:\ExampleDirectory" | |
New-Item -ItemType Directory -Path $directoryPath -Force | |
# Create a file in the directory | |
$filePath = "$directoryPath\example.txt" | |
"Hello, World!" | Out-File -FilePath $filePath | |
# Output the result | |
Write-Output "Directory and file created successfully." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment