Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Old script renamed to DriveMappping.ps1 #39

Closed
Schnabulation opened this issue May 4, 2022 · 3 comments
Closed

Question: Old script renamed to DriveMappping.ps1 #39

Schnabulation opened this issue May 4, 2022 · 3 comments

Comments

@Schnabulation
Copy link

Hi there...

This is a quick question: I have replaced the script DriveMapping.ps1 with a new version in InTune. The new script gets deployed perfectly fine but I have noticed that the already existing script on the endpoints gets renamed to DriveMappping.ps1 (with three "p" in the name).

This is not an issue with the script or its feature-set it's just that I could not find a function in the script that would be responsible for this renaming. Is this intended?

@nicolonsky
Copy link
Owner

nicolonsky commented May 4, 2022 via email

@Phenix51
Copy link

Phenix51 commented May 4, 2022

I had added a small section to my drivemapping script to removal of the old scheduled tasks when I had updated this prior to the old generated script being updated.

`$taskname = "IntuneDriveMapping","InTuneDriveMapping"

foreach ($task in $taskname)
{
$taskExists = Get-ScheduledTask | Where-Object {$_.TaskName -like $task }
If ($taskExists)
{ #Removes the Scheduled Task in queue
Unregister-ScheduledTask -TaskName $task -Confirm:$false
Write-Host "The Scheduled Task $task has been removed."
} else
{
Write-Host "The Scheduled Task $task did not exist."
}`

I wasn't concerned about the initial script since it wasn't being called by a scheduledtask any longer, but you could certainly have it built into your version of the script to search and remove the old DriveMappping.ps1 file if it exists on your user's PC.

@Schnabulation
Copy link
Author

Ah I see - this makes sense, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants