Node IIS AppCmd wrapper for building tasks for Visual Studio Team Services.
npm install --save vsts-iis
iis.Sites.add({
name: 'Default Web Site',
protocol: 'http',
port: 80,
host: '*',
path : 'C:/inetpub/wwwroot'
}).then(function() {
console.log("Success");
});;
iis.Sites.remove('Default Web Site')
.then(function() {
console.log("Success");
});
iis.Sites.start('Default Web Site')
.then(function() {
console.log("Success");
});
iis.Sites.stop('Default Web Site')
.then(function() {
console.log("Success");
});
iis.Sites.exists('Default Web Site')
.then(function(exists) {
if (exists) {
console.log("Site exists!");
} else {
console.log("Site does not exist!");
}
});
iis.AppPools.add('DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.AppPools.remove('DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.AppPools.start('DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.AppPools.stop('DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.AppPools.recycle('DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.AppPools.setIdentity('DefaultAppPool', 'ApplicationPoolIdentity')
.then(function() {
console.log("Success");
});
iis.AppPools.exists('DefaultAppPool')
.then(function(exists) {
if (exists) {
console.log("AppPool exists!");
} else {
console.log("AppPool does not exist!");
}
});
iis.Applications.add({
name: 'MyApplication',
virtualPath: '/',
physicalPath : 'C:/inetpub/wwwroot/MyApplication'
}).then(function() {
console.log("Success");
});;
iis.Applications.setAppPool('MyApplication', 'DefaultAppPool')
.then(function() {
console.log("Success");
});
iis.Applications.setWindowsAuthentication('MyApplication', true)
.then(function() {
console.log("Success");
});
iis.Applications.setAnonymousAuthentication('MyApplication', true)
.then(function() {
console.log("Success");
});
iis.Applications.exists('MyApplication')
.then(function(exists) {
if (exists) {
console.log("Application exists!");
} else {
console.log("Application does not exist!");
}
});