https://github.com/thecodermehedi/mkfile-powershell
mkfile (MakeFile) is a powershell function that creates one or more files in the specified paths. @thecodermehedi
https://github.com/thecodermehedi/mkfile-powershell
create-file custom-scripts powershell powershell-script powershell-utils ps1 thecodermehedi windows
Last synced: 10 months ago
JSON representation
mkfile (MakeFile) is a powershell function that creates one or more files in the specified paths. @thecodermehedi
- Host: GitHub
- URL: https://github.com/thecodermehedi/mkfile-powershell
- Owner: thecodermehedi
- License: mit
- Created: 2024-06-18T01:42:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-19T06:37:38.000Z (over 1 year ago)
- Last Synced: 2025-01-23T18:11:56.216Z (12 months ago)
- Topics: create-file, custom-scripts, powershell, powershell-script, powershell-utils, ps1, thecodermehedi, windows
- Language: PowerShell
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mkfile PowerShell Function
`mkfile` is a PowerShell function that allows you to create one or more files in the specified paths. If a directory does not exist, it will be created automatically. The function also supports options for displaying version information and additional details about the function itself.
## Installation
To install the `mkfile` function on your Windows operating system, you can use the following scripts:
### For PowerShell
```powershell
Start-Process powershell -Verb RunAs -Args '-nop -ep Bypass -c iex(New-Object Net.WebClient).DownloadString("https://raw.githubusercontent.com/thecodermehedi/mkfile-powershell/main/mkfile.ps1");ac$p"`n.$PSScriptRoot\mkfile.ps1"'
```
#### After executing the command refresh your powershell profile
```powershell
. $profile
```
### For Command Prompt (CMD)
```cmd
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Start-Process PowerShell -Verb RunAs -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command ""iex ((New-Object System.Net.WebClient).DownloadString(''https://raw.githubusercontent.com/thecodermehedi/mkfile-powershell/main/mkfile.ps1'')); Add-Content -Path $PROFILE -Value "`n. $env:USERPROFILE\Documents\WindowsPowerShell\mkfile.ps1""'"
```
## Usage
To use the `mkfile` function, follow these steps:
1. Open PowerShell.
2. Now you can use the `mkfile` function with various parameters:
```powershell
# Create a file in the current directory
mkfile index.html
# Create a file in a specific directory
mkfile src/main.ts
# Display version information
mkfile -v
# Display help
mkfile -?
# Display additional information about the function
mkfile -i
```
## Contributing
If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request in the GitHub repository.
## License
This project is licensed under the [MIT License](LICENSE).