Skip to content

dotnet-studies/Useful-Scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Useful C# scripts


First configurations

  1. Install .NET 10 (Latest Version) in this Link.
  2. To run the scripts need to use the following command:
dotnet run <name-script>.cs

Creating an Alias in Powershell

  1. To verify the location of the Powershell file run the following command: $PROFILE.
  2. Open the file in an text editor.
  3. Add the following function inside the file.
function control-hours {
  $filePath = (Get-ChildItem -Path "C:\Users\" -Recurse -Filter WorkTime.cs -ErrorAction SilentlyContinue | Select-Object -First 1).FullName

  if (-not $filePath) {
    Write-Host "File WorkTime.cs not found!" -ForegroundColor Red
    return
  }

  dotnet run $filePath
}

New-Alias ch control-hours
  1. This code is going to look for the file WorkTime.cs into your computer and when found it's going to run with dotnet.

I'll let the complete example of the functions to copy and paste into your powershell configuration.

About

Versioning System to check the PCF version

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •