Code Monkey home page Code Monkey logo

Comments (3)

nicolonsky avatar nicolonsky commented on August 10, 2024

from intunedrivemapping.

Phenix51 avatar Phenix51 commented on August 10, 2024

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.

from intunedrivemapping.

Schnabulation avatar Schnabulation commented on August 10, 2024

Ah I see - this makes sense, thank you!

from intunedrivemapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.