Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Script:
# Define the root directory
$rootDir = "C:\project-root"
# Define the folder structure
$folders = @(
"$rootDir\assets",
"$rootDir\assets\css",
"$rootDir\assets\imgs",
"$rootDir\assets\js",
"$rootDir\layouts"
)
# Define the files to be created
$files = @(
"$rootDir\assets\css\style.css",
"$rootDir\layouts\header.php",
"$rootDir\layouts\footer.php",
"$rootDir\index.php"
)
# Create the folders
foreach ($folder in $folders) {
if (-not (Test-Path -Path $folder)) {
New-Item -ItemType Directory -Path $folder
Write-Output "Created folder: $folder"
} else {
Write-Output "Folder already exists: $folder"
}
}
# Create the files
foreach ($file in $files) {
if (-not (Test-Path -Path $file)) {
New-Item -ItemType File -Path $file
Write-Output "Created file: $file"
} else {
Write-Output "File already exists: $file"
}
}
Como Executar o Script:
.ps1
, por exemplo, create-structure.ps1
.cd
no PowerShell..\create-structure.ps1
e pressione Enter.