If you are ok with including the extension this should do what you want.
$outputPath = "D:\Server\User\CUST\MEA\Data\In\Files\CORRECTED\CUST_MEAFile.csv"
$outputFile = Split-Path $outputPath -leaf
More Related Contents:
- What’s the best way to determine the location of the current PowerShell script?
- Is there a way to make a PowerShell script work by double clicking a .ps1 file?
- Save hash table in PowerShell object notation (PSON)
- Redirecting standard input\output in Windows PowerShell
- How to perform keystroke inside powershell?
- When should I use Write-Error vs. Throw? Terminating vs. non-terminating errors
- Delete files older than 15 days using PowerShell
- How do I write to standard error in PowerShell?
- Get remote registry value
- Executing an EXE file using a PowerShell script
- How to get an MD5 checksum in PowerShell
- Obtaining ExitCode using Start-Process and WaitForExit instead of -Wait
- Redirection of standard and error output appending to the same log file
- How to properly -filter multiple strings in a PowerShell copy script
- PowerShell – Decode System.Security.SecureString to readable password
- How do I include a locally defined function when using PowerShell’s Invoke-Command for remoting?
- Methods to hex edit binary files via Powershell
- Comparing array variables in PowerShell
- Copy file remotely with PowerShell
- How to speed up Powershell Get-Childitem over UNC
- Powershell script to see currently logged in users (domain and machine) + status (active, idle, away)
- Using Invoke-Command -ScriptBlock on a function with arguments
- Gracefully stopping in Powershell
- Powershell – Reboot and Continue Script
- Hashtables and key order
- Can’t install nuget package because of “Failed to initialize the PowerShell host”
- PowerShell The term is not recognized as cmdlet function script file or operable program
- What security setting is preventing Remote PowerShell 2.0 from accessing UNC paths
- List hidden sub-directories and sizes
- Prevent trailing newline in PowerShell Out-File command